Liquid includes that builds Attribution list of links
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.
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}"
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>
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
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!
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>
This repository may not be feature complete and/or fully functional, Pull Requests that add features or fix bugs are certainly welcomed.
-
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, iftrue
then attempt to derive Font Awesome class from linkhref
orurl
-
links
object list, page configurationtext
string, displayed within HTMLa
tagtitle
string, displayed on hover of HTMLa
taghref
orurl
string, asset that browser will navigate to upon clickrel
string, defaultnofollow noreferrer
class
string, overwrites parsed Font Awesome by manually assign link class
-
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.
Options for contributing to includes-attribution and liquid-utilities
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 setfork
as the default remote, eg.git push fork main
however, this will also default thefork
remote for pulling from too! Meaning that pulling updates fromorigin
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.
Thanks for even considering it!
With 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.
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.