Skip to content

liquid-utilities/includes-attribution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Includes Attribution

Liquid includes that builds Attribution list of links

Byte size of Includes Attribution Open Issues Open Pull Requests Latest commits includes-attribution Demos



Requirements

This repository depends upon Jekyll which is supported by GitHub Pages, further details about setup can be found from documentation published by the Jekyll maintainers regarding GitHub Pages.


Quick Start

This repository encourages the use of Git Submodules to track dependencies

Bash Variables

_module_name='includes-attribution'
_module_https_url="https://github.com/liquid-utilities/includes-attribution.git"
_module_base_dir='_includes/modules'
_module_path="${_module_base_dir}/${_module_name}"

Bash Submodule Commands

cd "<your-git-project-path>"


git checkout gh-pages

mkdir -vp "${_module_base_dir}"


git submodule add -b main\
                  --name "${_module_name}"\
                  "${_module_https_url}"\
                  "${_module_path}"

Your Layout File

Example post layout modifications...

_layouts/post.html

---
layout: default
license: MIT
source: https://raw.githubusercontent.com/jekyll/minima/v2.0.0/_layouts/post.html
---
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">

  <header class="post-header">
    <h1 class="post-title" itemprop="name headline">{{ page.title | escape }}</h1>
    <p class="post-meta"><time datetime="{{ page.date | date_to_xmlschema }}" itemprop="datePublished">{{ page.date | date: "%b %-d, %Y" }}</time>{% if page.author %} β€’ <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">{{ page.author }}</span></span>{% endif %}</p>
  </header>

  <div class="post-content" itemprop="articleBody">
    {{ content }}
    {%- if page.attribution -%}
      {%- include modules/includes-attribution/attribution.html -%}
    {%- endif -%}
  </div>

  {% if site.disqus.shortname %}
    {% include disqus_comments.html %}
  {% endif %}
</article>

Your ReadMe File

Suggested additions for your ReadMe.md file so everyone has a good time with submodules

Clone with the following to avoid incomplete downloads


    git clone --recurse-submodules <url-for-your-project>


Update/upgrade submodules via


    git submodule update --init --merge --recursive

Commit and Push

git add .gitmodules
git add "${_module_path}"


## Add any changed files too


git commit -F- <<'EOF'
:heavy_plus_sign: Adds `liquid-utilities/includes-attribution#1` submodule



**Additions**


- `.gitmodules`, tracks submodules AKA Git within Git _fanciness_

- `README.md`, updates installation and updating guidance

- `_modules_/includes-attribution`, Liquid includes that builds Attribution list of links
EOF


git push origin gh-pages

πŸŽ‰ Excellent πŸŽ‰ your project is now ready to begin unitizing code from this repository!


Usage

Site _config.yml configurations

attribution:
  title: Attribution
  class_prefix: attribution
  auto_font_awesome: true

Post FrontMatter

attribution:
  links:
    - text: Google
      href: https://google.com
      title: Link to Google web search engine

    - text: GitHub
      url: https://github.com
      title: Link to GitHub

HTML results

<h2 class="attribution__heading"
    id="heading__attribution"
    >Attribution
</h2>

<ul class="attribution__list">
  <li class="attribution__item">
    <a href="https://google.com"
       title="Link to Google web search engine"
       class="fa fa-google attribution__link"
       rel="nofollow noreferrer">Google</a>
  </li>

  <li class="attribution__item">
    <a href="https://github.com"
       title="Link to GitHub"
       class="fa fa-github attribution__link"
       rel="nofollow noreferrer">GitHub</a>
  </li>
</ul>

Notes

This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.


FrontMatter API

  • attribution object, site or page configuration namespace

    • title string, site or page configuration for list heading title

    • class_prefix string, site or page configuration for HTML classes

    • auto_font_awesome boolean, if true then attempt to derive Font Awesome class from link href or url

    • links object list, page configuration

      • text string, displayed within HTML a tag
      • title string, displayed on hover of HTML a tag
      • href or url string, asset that browser will navigate to upon click
      • rel string, default nofollow noreferrer
      • class string, overwrites parsed Font Awesome by manually assign link class

CSS Styling

This project is compatible with Font Awesome, include a link to their style sheet for easy icons...

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

This project utilizes BEM (Block Element Modifier) syntax for HTML/CSS class names, the block may be modified via class_prefix of page FrontMatter and/or site configuration file.


Contributing

Options for contributing to includes-attribution and liquid-utilities


Forking

Start making a Fork of this repository to an account that you have write permissions for.

  • Add remote for fork URL. The URL syntax is git@github.com:<NAME>/<REPO>.git...
cd ~/git/hub/liquid-utilities/includes-attribution

git remote add fork git@github.com:<NAME>/includes-attribution.git
  • Commit your changes and push to your fork, eg. to fix an issue...
cd ~/git/hub/liquid-utilities/includes-attribution


git commit -F- <<'EOF'
:bug: Fixes #42 Issue


**Edits**


- `<SCRIPT-NAME>` script, fixes some bug reported in issue
EOF


git push fork main

Note, the -u option may be used to set fork as the default remote, eg. git push fork main however, this will also default the fork remote for pulling from too! Meaning that pulling updates from origin must be done explicitly, eg. git pull origin main

  • Then on GitHub submit a Pull Request through the Web-UI, the URL syntax is https://github.com/<NAME>/<REPO>/pull/new/<BRANCH>

Note; to decrease the chances of your Pull Request needing modifications before being accepted, please check the dot-github repository for detailed contributing guidelines.


Sponsor

Thanks for even considering it!

With sponsor__shields_io__liberapay you may sponsor liquid-utilities on a repeating basis.

Regardless of if you're able to financially support projects such as includes-attribution that liquid-utilities maintains, please consider sharing projects that are useful with others, because one of the goals of maintaining Open Source repositories is to provide value to the community.


Attribution


License

Liquid includes that builds Attribution list of links
Copyright (C) 2020 S0AndS0

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

For further details review full length version of AGPL-3.0 License.