mirror of
https://gitlab.com/MisterBiggs/blog.git
synced 2025-06-16 15:17:28 +00:00
switch to pelican
This commit is contained in:
parent
2acab8eed1
commit
729de378dd
184
.gitignore
vendored
Normal file
184
.gitignore
vendored
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
|
||||||
|
|
||||||
|
# Created by https://www.gitignore.io/api/visualstudiocode,windows,python,venv
|
||||||
|
# Edit at https://www.gitignore.io/?templates=visualstudiocode,windows,python,venv
|
||||||
|
|
||||||
|
### Python ###
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
pip-wheel-metadata/
|
||||||
|
share/python-wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
.hypothesis/
|
||||||
|
.pytest_cache/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
local_settings.py
|
||||||
|
db.sqlite3
|
||||||
|
db.sqlite3-journal
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
.python-version
|
||||||
|
|
||||||
|
# pipenv
|
||||||
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
|
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||||
|
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||||
|
# install all needed dependencies.
|
||||||
|
#Pipfile.lock
|
||||||
|
|
||||||
|
# celery beat schedule file
|
||||||
|
celerybeat-schedule
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
### venv ###
|
||||||
|
# Virtualenv
|
||||||
|
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
|
||||||
|
[Bb]in
|
||||||
|
[Ii]nclude
|
||||||
|
[Ll]ib
|
||||||
|
[Ll]ib64
|
||||||
|
[Ll]ocal
|
||||||
|
[Ss]cripts
|
||||||
|
pyvenv.cfg
|
||||||
|
pip-selfcheck.json
|
||||||
|
|
||||||
|
### VisualStudioCode ###
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
|
||||||
|
### VisualStudioCode Patch ###
|
||||||
|
# Ignore all local history of files
|
||||||
|
.history
|
||||||
|
|
||||||
|
### Windows ###
|
||||||
|
# Windows thumbnail cache files
|
||||||
|
Thumbs.db
|
||||||
|
Thumbs.db:encryptable
|
||||||
|
ehthumbs.db
|
||||||
|
ehthumbs_vista.db
|
||||||
|
|
||||||
|
# Dump file
|
||||||
|
*.stackdump
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
[Dd]esktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
# End of https://www.gitignore.io/api/visualstudiocode,windows,python,venv
|
||||||
|
|
||||||
|
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
image: monachus/hugo
|
|
||||||
|
|
||||||
|
|
||||||
pages:
|
|
||||||
before_script:
|
|
||||||
- git submodule sync --recursive
|
|
||||||
- git submodule update --init --recursive
|
|
||||||
script:
|
|
||||||
- cd blog
|
|
||||||
- hugo -d ../public
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- public
|
|
||||||
only:
|
|
||||||
- master
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "Sites/blog/themes/hugo-swift-theme"]
|
|
||||||
path = Sites/blog/themes/hugo-swift-theme
|
|
||||||
url = https://github.com/onweru/hugo-swift-theme.git
|
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"python.pythonPath": "pelican\\Scripts\\python.exe"
|
||||||
|
}
|
201
bin/LICENSE
201
bin/LICENSE
@ -1,201 +0,0 @@
|
|||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
187
bin/README.md
187
bin/README.md
@ -1,187 +0,0 @@
|
|||||||

|
|
||||||
|
|
||||||
A Fast and Flexible Static Site Generator built with love by [bep](https://github.com/bep), [spf13](http://spf13.com/) and [friends](https://github.com/gohugoio/hugo/graphs/contributors) in [Go][].
|
|
||||||
|
|
||||||
[Website](https://gohugo.io) |
|
|
||||||
[Forum](https://discourse.gohugo.io) |
|
|
||||||
[Documentation](https://gohugo.io/getting-started/) |
|
|
||||||
[Installation Guide](https://gohugo.io/getting-started/installing/) |
|
|
||||||
[Contribution Guide](CONTRIBUTING.md) |
|
|
||||||
[Twitter](https://twitter.com/gohugoio)
|
|
||||||
|
|
||||||
[](https://godoc.org/github.com/gohugoio/hugo)
|
|
||||||
[](https://travis-ci.org/gohugoio/hugo)
|
|
||||||
[](https://goreportcard.com/report/github.com/gohugoio/hugo)
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
Hugo is a static HTML and CSS website generator written in [Go][].
|
|
||||||
It is optimized for speed, ease of use, and configurability.
|
|
||||||
Hugo takes a directory with content and templates and renders them into a full HTML website.
|
|
||||||
|
|
||||||
Hugo relies on Markdown files with front matter for metadata, and you can run Hugo from any directory.
|
|
||||||
This works well for shared hosts and other systems where you don’t have a privileged account.
|
|
||||||
|
|
||||||
Hugo renders a typical website of moderate size in a fraction of a second.
|
|
||||||
A good rule of thumb is that each piece of content renders in around 1 millisecond.
|
|
||||||
|
|
||||||
Hugo is designed to work well for any kind of website including blogs, tumbles, and docs.
|
|
||||||
|
|
||||||
#### Supported Architectures
|
|
||||||
|
|
||||||
Currently, we provide pre-built Hugo binaries for Windows, Linux, FreeBSD, NetBSD, macOS (Darwin), and [Android](https://gist.github.com/bep/a0d8a26cf6b4f8bc992729b8e50b480b) for x64, i386 and ARM architectures.
|
|
||||||
|
|
||||||
Hugo may also be compiled from source wherever the Go compiler tool chain can run, e.g. for other operating systems including DragonFly BSD, OpenBSD, Plan 9, and Solaris.
|
|
||||||
|
|
||||||
**Complete documentation is available at [Hugo Documentation](https://gohugo.io/getting-started/).**
|
|
||||||
|
|
||||||
## Choose How to Install
|
|
||||||
|
|
||||||
If you want to use Hugo as your site generator, simply install the Hugo binaries.
|
|
||||||
The Hugo binaries have no external dependencies.
|
|
||||||
|
|
||||||
To contribute to the Hugo source code or documentation, you should [fork the Hugo GitHub project](https://github.com/gohugoio/hugo#fork-destination-box) and clone it to your local machine.
|
|
||||||
|
|
||||||
Finally, you can install the Hugo source code with `go`, build the binaries yourself, and run Hugo that way.
|
|
||||||
Building the binaries is an easy task for an experienced `go` getter.
|
|
||||||
|
|
||||||
### Install Hugo as Your Site Generator (Binary Install)
|
|
||||||
|
|
||||||
Use the [installation instructions in the Hugo documentation](https://gohugo.io/getting-started/installing/).
|
|
||||||
|
|
||||||
### Build and Install the Binaries from Source (Advanced Install)
|
|
||||||
|
|
||||||
#### Prerequisite Tools
|
|
||||||
|
|
||||||
* [Git](https://git-scm.com/)
|
|
||||||
* [Go (at least Go 1.11)](https://golang.org/dl/)
|
|
||||||
|
|
||||||
#### Fetch from GitHub
|
|
||||||
|
|
||||||
Since Hugo 0.48, Hugo uses the Go Modules support built into Go 1.11 to build. The easiest is to clone Hugo in a directory outside of `GOPATH`, as in the following example:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
mkdir $HOME/src
|
|
||||||
cd $HOME/src
|
|
||||||
git clone https://github.com/gohugoio/hugo.git
|
|
||||||
cd hugo
|
|
||||||
go install
|
|
||||||
```
|
|
||||||
|
|
||||||
**If you are a Windows user, substitute the `$HOME` environment variable above with `%USERPROFILE%`.**
|
|
||||||
|
|
||||||
## The Hugo Documentation
|
|
||||||
|
|
||||||
The Hugo documentation now lives in its own repository, see https://github.com/gohugoio/hugoDocs. But we do keep a version of that documentation as a `git subtree` in this repository. To build the sub folder `/docs` as a Hugo site, you need to clone this repo:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone git@github.com:gohugoio/hugo.git
|
|
||||||
```
|
|
||||||
## Contributing to Hugo
|
|
||||||
|
|
||||||
For a complete guide to contributing to Hugo, see the [Contribution Guide](CONTRIBUTING.md).
|
|
||||||
|
|
||||||
We welcome contributions to Hugo of any kind including documentation, themes,
|
|
||||||
organization, tutorials, blog posts, bug reports, issues, feature requests,
|
|
||||||
feature implementations, pull requests, answering questions on the forum,
|
|
||||||
helping to manage issues, etc.
|
|
||||||
|
|
||||||
The Hugo community and maintainers are [very active](https://github.com/gohugoio/hugo/pulse/monthly) and helpful, and the project benefits greatly from this activity.
|
|
||||||
|
|
||||||
### Asking Support Questions
|
|
||||||
|
|
||||||
We have an active [discussion forum](https://discourse.gohugo.io) where users and developers can ask questions.
|
|
||||||
Please don't use the GitHub issue tracker to ask questions.
|
|
||||||
|
|
||||||
### Reporting Issues
|
|
||||||
|
|
||||||
If you believe you have found a defect in Hugo or its documentation, use
|
|
||||||
the GitHub issue tracker to report the problem to the Hugo maintainers.
|
|
||||||
If you're not sure if it's a bug or not, start by asking in the [discussion forum](https://discourse.gohugo.io).
|
|
||||||
When reporting the issue, please provide the version of Hugo in use (`hugo version`).
|
|
||||||
|
|
||||||
### Submitting Patches
|
|
||||||
|
|
||||||
The Hugo project welcomes all contributors and contributions regardless of skill or experience level.
|
|
||||||
If you are interested in helping with the project, we will help you with your contribution.
|
|
||||||
Hugo is a very active project with many contributions happening daily.
|
|
||||||
|
|
||||||
Because we want to create the best possible product for our users and the best contribution experience for our developers,
|
|
||||||
we have a set of guidelines which ensure that all contributions are acceptable.
|
|
||||||
The guidelines are not intended as a filter or barrier to participation.
|
|
||||||
If you are unfamiliar with the contribution process, the Hugo team will help you and teach you how to bring your contribution in accordance with the guidelines.
|
|
||||||
|
|
||||||
For a complete guide to contributing code to Hugo, see the [Contribution Guide](CONTRIBUTING.md).
|
|
||||||
|
|
||||||
[](https://github.com/igrigorik/ga-beacon)
|
|
||||||
|
|
||||||
[Go]: https://golang.org/
|
|
||||||
[Hugo Documentation]: https://gohugo.io/overview/introduction/
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
Hugo stands on the shoulder of many great open source libraries, in lexical order:
|
|
||||||
|
|
||||||
| Dependency | License |
|
|
||||||
| :------------- | :------------- |
|
|
||||||
| [github.com/BurntSushi/locker](https://github.com/BurntSushi/locker) | The Unlicense |
|
|
||||||
| [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) | MIT License |
|
|
||||||
| [github.com/PuerkitoBio/purell](https://github.com/PuerkitoBio/purell) | BSD 3-Clause "New" or "Revised" License |
|
|
||||||
| [github.com/PuerkitoBio/urlesc](https://github.com/PuerkitoBio/urlesc) | BSD 3-Clause "New" or "Revised" License |
|
|
||||||
| [github.com/alecthomas/chroma](https://github.com/alecthomas/chroma) | MIT License |
|
|
||||||
| [github.com/bep/debounce](https://github.com/bep/debounce) | MIT License |
|
|
||||||
| [github.com/bep/gitmap](https://github.com/bep/gitmap) | MIT License |
|
|
||||||
| [github.com/bep/go-tocss](https://github.com/bep/go-tocss) | MIT License |
|
|
||||||
| [github.com/niklasfasching/go-org](https://github.com/niklasfasching/go-org) | MIT License |
|
|
||||||
| [github.com/cpuguy83/go-md2man](https://github.com/cpuguy83/go-md2man) | MIT License |
|
|
||||||
| [github.com/danwakefield/fnmatch](https://github.com/danwakefield/fnmatch) | BSD 2-Clause "Simplified" License |
|
|
||||||
| [github.com/disintegration/imaging](https://github.com/disintegration/imaging) | MIT License |
|
|
||||||
| [github.com/dlclark/regexp2](https://github.com/dlclark/regexp2) | MIT License |
|
|
||||||
| [github.com/eknkc/amber](https://github.com/eknkc/amber) | MIT License |
|
|
||||||
| [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) | BSD 3-Clause "New" or "Revised" License |
|
|
||||||
| [github.com/gobwas/glob](https://github.com/gobwas/glob) | MIT License |
|
|
||||||
| [github.com/gorilla/websocket](https://github.com/gorilla/websocket) | BSD 2-Clause "Simplified" License |
|
|
||||||
| [github.com/hashicorp/go-immutable-radix](https://github.com/hashicorp/go-immutable-radix) | Mozilla Public License 2.0 |
|
|
||||||
| [github.com/hashicorp/golang-lru](https://github.com/hashicorp/golang-lru) | Mozilla Public License 2.0 |
|
|
||||||
| [github.com/hashicorp/hcl](https://github.com/hashicorp/hcl) | Mozilla Public License 2.0 |
|
|
||||||
| [github.com/jdkato/prose](https://github.com/jdkato/prose) | MIT License |
|
|
||||||
| [github.com/kyokomi/emoji](https://github.com/kyokomi/emoji) | MIT License |
|
|
||||||
| [github.com/magiconair/properties](https://github.com/magiconair/properties) | BSD 2-Clause "Simplified" License |
|
|
||||||
| [github.com/markbates/inflect](https://github.com/markbates/inflect) | MIT License |
|
|
||||||
| [github.com/mattn/go-isatty](https://github.com/mattn/go-isatty) | MIT License |
|
|
||||||
| [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) | MIT License |
|
|
||||||
| [github.com/miekg/mmark](https://github.com/miekg/mmark) | Simplified BSD License |
|
|
||||||
| [github.com/mitchellh/hashstructure](https://github.com/mitchellh/hashstructure) | MIT License |
|
|
||||||
| [github.com/mitchellh/mapstructure](https://github.com/mitchellh/mapstructure) | MIT License |
|
|
||||||
| [github.com/muesli/smartcrop](https://github.com/muesli/smartcrop) | MIT License |
|
|
||||||
| [github.com/nicksnyder/go-i18n](https://github.com/nicksnyder/go-i18n) | MIT License |
|
|
||||||
| [github.com/olekukonko/tablewriter](https://github.com/olekukonko/tablewriter) | MIT License |
|
|
||||||
| [github.com/pelletier/go-toml](https://github.com/pelletier/go-toml) | MIT License |
|
|
||||||
| [github.com/pkg/errors](https://github.com/pkg/errors) | BSD 2-Clause "Simplified" License |
|
|
||||||
| [github.com/russross/blackfriday](https://github.com/russross/blackfriday) | Simplified BSD License |
|
|
||||||
| [github.com/shurcooL/sanitized_anchor_name](https://github.com/shurcooL/sanitized_anchor_name) | MIT License |
|
|
||||||
| [github.com/spf13/afero](https://github.com/spf13/afero) | Apache License 2.0 |
|
|
||||||
| [github.com/spf13/cast](https://github.com/spf13/cast) | MIT License |
|
|
||||||
| [github.com/spf13/cobra](https://github.com/spf13/cobra) | Apache License 2.0 |
|
|
||||||
| [github.com/spf13/fsync](https://github.com/spf13/fsync) | MIT License |
|
|
||||||
| [github.com/spf13/jwalterweatherman](https://github.com/spf13/jwalterweatherman) | MIT License |
|
|
||||||
| [github.com/spf13/nitro](https://github.com/spf13/nitro) | Apache License 2.0 |
|
|
||||||
| [github.com/spf13/pflag](https://github.com/spf13/pflag) | BSD 3-Clause "New" or "Revised" License |
|
|
||||||
| [github.com/spf13/viper](https://github.com/spf13/viper) | MIT License |
|
|
||||||
| [github.com/tdewolff/minify](https://github.com/tdewolff/minify) | MIT License |
|
|
||||||
| [github.com/tdewolff/parse](https://github.com/tdewolff/parse) | MIT License |
|
|
||||||
| [github.com/wellington/go-libsass](https://github.com/wellington/go-libsass) | Apache License 2.0 |
|
|
||||||
| [github.com/yosssi/ace](https://github.com/yosssi/ace) | MIT License |
|
|
||||||
| [golang.org/x/image](https://golang.org/x/image) | BSD 3-Clause "New" or "Revised" License |
|
|
||||||
| [golang.org/x/net](https://golang.org/x/net) | BSD 3-Clause "New" or "Revised" License |
|
|
||||||
| [golang.org/x/sync](https://golang.org/x/sync) | BSD 3-Clause "New" or "Revised" License |
|
|
||||||
| [golang.org/x/sys](https://golang.org/x/sys) | BSD 3-Clause "New" or "Revised" License |
|
|
||||||
| [golang.org/x/text](https://golang.org/x/text) | BSD 3-Clause "New" or "Revised" License
|
|
||||||
| [gopkg.in/yaml.v2](https://gopkg.in/yaml.v2) | Apache License 2.0 |
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
bin/hugo.exe
BIN
bin/hugo.exe
Binary file not shown.
82
blog/Makefile
Normal file
82
blog/Makefile
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
PY?=python3
|
||||||
|
PELICAN?=pelican
|
||||||
|
PELICANOPTS=
|
||||||
|
|
||||||
|
BASEDIR=$(CURDIR)
|
||||||
|
INPUTDIR=$(BASEDIR)/content
|
||||||
|
OUTPUTDIR=$(BASEDIR)/output
|
||||||
|
CONFFILE=$(BASEDIR)/pelicanconf.py
|
||||||
|
PUBLISHCONF=$(BASEDIR)/publishconf.py
|
||||||
|
|
||||||
|
GITHUB_PAGES_BRANCH=master
|
||||||
|
|
||||||
|
|
||||||
|
DEBUG ?= 0
|
||||||
|
ifeq ($(DEBUG), 1)
|
||||||
|
PELICANOPTS += -D
|
||||||
|
endif
|
||||||
|
|
||||||
|
RELATIVE ?= 0
|
||||||
|
ifeq ($(RELATIVE), 1)
|
||||||
|
PELICANOPTS += --relative-urls
|
||||||
|
endif
|
||||||
|
|
||||||
|
help:
|
||||||
|
@echo 'Makefile for a pelican Web site '
|
||||||
|
@echo ' '
|
||||||
|
@echo 'Usage: '
|
||||||
|
@echo ' make html (re)generate the web site '
|
||||||
|
@echo ' make clean remove the generated files '
|
||||||
|
@echo ' make regenerate regenerate files upon modification '
|
||||||
|
@echo ' make publish generate using production settings '
|
||||||
|
@echo ' make serve [PORT=8000] serve site at http://localhost:8000'
|
||||||
|
@echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
|
||||||
|
@echo ' make devserver [PORT=8000] serve and regenerate together '
|
||||||
|
@echo ' make ssh_upload upload the web site via SSH '
|
||||||
|
@echo ' make rsync_upload upload the web site via rsync+ssh '
|
||||||
|
@echo ' make github upload the web site via gh-pages '
|
||||||
|
@echo ' '
|
||||||
|
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
|
||||||
|
@echo 'Set the RELATIVE variable to 1 to enable relative urls '
|
||||||
|
@echo ' '
|
||||||
|
|
||||||
|
html:
|
||||||
|
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
|
||||||
|
|
||||||
|
regenerate:
|
||||||
|
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
|
||||||
|
|
||||||
|
serve:
|
||||||
|
ifdef PORT
|
||||||
|
$(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
|
||||||
|
else
|
||||||
|
$(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
serve-global:
|
||||||
|
ifdef SERVER
|
||||||
|
$(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b $(SERVER)
|
||||||
|
else
|
||||||
|
$(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
devserver:
|
||||||
|
ifdef PORT
|
||||||
|
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT)
|
||||||
|
else
|
||||||
|
$(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
publish:
|
||||||
|
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
|
||||||
|
|
||||||
|
github: publish
|
||||||
|
ghp-import -m "Generate Pelican site" -b $(GITHUB_PAGES_BRANCH) $(OUTPUTDIR)
|
||||||
|
git push origin $(GITHUB_PAGES_BRANCH)
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: html help clean regenerate serve serve-global devserver publish github
|
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
title: "{{ replace .Name "-" " " | title }}"
|
|
||||||
date: {{ .Date }}
|
|
||||||
draft: true
|
|
||||||
---
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
baseURL = "https://misterbiggs.gitlab.io/blog/"
|
|
||||||
languageCode = "en-us"
|
|
||||||
title = "Anson 3D"
|
|
||||||
theme = "hugo-swift-theme"
|
|
||||||
pygmentsCodefences = true
|
|
||||||
pygmentsCodefencesGuessSyntax = true
|
|
||||||
|
|
||||||
[params]
|
|
||||||
twitter = 'https://twitter.com/Anson_3D'
|
|
||||||
|
|
||||||
# [Params.staticman]
|
|
||||||
# endpoint = "https://api.staticman.net"
|
|
||||||
# gitProvider = "gitlab"
|
|
||||||
# username = "MisterBiggs"
|
|
||||||
# repository = "hugo-swift-theme"
|
|
||||||
# branch = "master"
|
|
@ -1,75 +0,0 @@
|
|||||||
---
|
|
||||||
title: "How to Export Fusion 360 files to Other File Types"
|
|
||||||
date: 2019-12-09T21:56:14-07:00
|
|
||||||
image: https://i.imgur.com/q7V9tC5.jpg
|
|
||||||
author: Anson Biggs
|
|
||||||
---
|
|
||||||
|
|
||||||
A major downfall of Fusion 360 is its lack of exporting options, and its main filetype .f3d seems to be closed source and isn't supported by any other programs. Processes like exporting to a .step or .obj then using something else like Autodesk Inventor or Blender then exporting to your final filetype from those programs can sometimes cause artifacts, loss of dimensions, and can take a very long time to convert. Luckily Fusion has more export options built in, and they don't show the functionality in their desktop program.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## [Go to the Autodesk 360 Dashboard](https://myhub.autodesk360.com)
|
|
||||||
|
|
||||||
Going to [https://myhub.autodesk360.com](https://myhub.autodesk360.com) will give you a similar looking Project and file options as the data panel in the Desktop version. Navigate to your model and open it. Whether you are in the Design View or the 3D View in the top right corner, you'll have a few options to choose from.
|
|
||||||
Clicking the download button provides you with a ton more options than the desktop version offers. Unfortunately, you cannot download straight from the website as it takes time to convert, so you have to wait for an email. In my experience, this usually takes less than a minute although I would imagine more complex models take more time.
|
|
||||||
Below I have a list of every file-type that can be exported and a quick summary of what they are good for.
|
|
||||||
|
|
||||||
## Fusion 360 Export Formats
|
|
||||||
|
|
||||||
_If you have anything to add to this table please contact me._
|
|
||||||
|
|
||||||
<table style="white-space: normal;">
|
|
||||||
<tr>
|
|
||||||
<th>Format<br></th>
|
|
||||||
<th>What its good for.<br></th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Fusion 360 Archive</td>
|
|
||||||
<td>Provides a .f3d file-type which is a proprietary file-type for Fusion 360. Preserves full model functionality when opened in any Fusion 360, and is a great way to make personal backups of Fusion Models.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Inventor 2016</td>
|
|
||||||
<td>Downloads either a single .ipt if the part is a single component, or multiple .ipt files and a .iam if your Fusion model contains multiple components. .ipt is an Inventor Part file, and .iam is an Inventor Assembly file. The models lose all parametric abilities, but keep dimensions and shape.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>IGES</td>
|
|
||||||
<td>.iges is an open CAD format and should be usable in any CAD software. Does not retain any parametric elements</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>SAT</td>
|
|
||||||
<td>Developed by Dassault Systems but is a pretty widely accepted file-type for CAD software. Does not retain any parametric elements.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>SMT</td>
|
|
||||||
<td>Only usable by Fusion 360 and Inventor 2019</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>STEP</td>
|
|
||||||
<td>.step is an open CAD format and should be usable in any CAD software. Does not retain any parametric elements</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>DWG</td>
|
|
||||||
<td>Autodesk AutoCAD file format. Exports a wireframe of your model. Great for exporting to AutoCAd but otherwise useless.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>DXF</td>
|
|
||||||
<td>Drawing format. Exports a wireframe of your model. Much better off making an actual drawing in fusion then exporting a .dxf</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>STL</td>
|
|
||||||
<td>.stl is an open standard used by most 3D modeling and CAD programs and is great for 3D printing, keep in mind that units are not stored in .stl formats, so it is important to remember what units your model was created in. If you aren't prompted by the soft then it likely assumed millimeters so you may need to convert yourself by scaling the model.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>FBX</td>
|
|
||||||
<td>Autodesk owned file format. No real use in CAD and doesn't preserve dimensions so you end up with a tiny model.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>SketchUp</td>
|
|
||||||
<td>Exports a .skp which opens in SketchUp perfectly, Great if you want to use your part in a SketchUp Project.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>OBJ</td>
|
|
||||||
<td>.obj or Object is an open format and the geometry should be workable in most 3D modeling or CAD programs. </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
@ -1,78 +0,0 @@
|
|||||||
---
|
|
||||||
title: "My First Post"
|
|
||||||
date: 2019-08-08T21:56:14-07:00
|
|
||||||
draft: true
|
|
||||||
image: https://i.imgur.com/q7V9tC5.jpg
|
|
||||||
author: Anson Biggs
|
|
||||||
---
|
|
||||||
|
|
||||||
# Nec retia pavet vultus ligati maesta
|
|
||||||
|
|
||||||
## Postquam te vulnere lucoque ferunt
|
|
||||||
|
|
||||||
```python3
|
|
||||||
numbers = [1, 2, 3, 4, 5, 6,]
|
|
||||||
|
|
||||||
for number in numbers:
|
|
||||||
print(number)
|
|
||||||
```
|
|
||||||
|
|
||||||
Lorem markdownum miserande hanc et Midan ostendit artis vertuntur lingua. Thoona
|
|
||||||
de finibus celeres nec animam, dumque constituunt fila cognataque narrat verba.
|
|
||||||
Ille animi vertuntur liquores bobus, caput _virentes regnum eduxit_ totumque in
|
|
||||||
saxa, fortis _vela_ vertere auguror recisum. Revelli et maxima veniat tuorum
|
|
||||||
[matris](http://parsnec.org/fide.html) curaque, praemiaque corripit quid hoc
|
|
||||||
tendunt haec, et parens rates haut et! Caput annos, _in fasque albescere_ manu:
|
|
||||||
natae origine palmis; et [illa simulat](http://aevoque-arserunt.org/sit), vix
|
|
||||||
mares!
|
|
||||||
|
|
||||||
- Decuit curam Iovis
|
|
||||||
- Dant ille plumas lora omnes nota
|
|
||||||
- Amborum hoc Abas temptatae ferat enodisque viveret
|
|
||||||
|
|
||||||
## Respicit lacertos
|
|
||||||
|
|
||||||
Factum est dictoque relinqui a tantae nulla adquirit mercede quamquam, aliquid
|
|
||||||
recepit: **exigit levatus**: est. Ergo sentit lora. Tamen fulvo traherent servo
|
|
||||||
edidicitque longa, seducta invenio vertitur. Carinas et edita in mihi oculus
|
|
||||||
populisque, motu duorum atque nullos herbis flumina iunctum fecisse corpus!
|
|
||||||
Capistris vitam sed super ferunt.
|
|
||||||
|
|
||||||
> Atque fama alvum idem post negat virga illis terque, animos vestigia ut peti.
|
|
||||||
> Amnem mulcet **fretum** dat cursus fuit Iunonia de amplexus auctor corpore est
|
|
||||||
> corpore: annis est nubila probat: quod. Nostri fixurus Haemoniis frondem
|
|
||||||
> [excedam forte](http://si.io/minos.html); luserit pueri iam quae **repetens
|
|
||||||
> Quirini vulgarunt** inter **residunt**.
|
|
||||||
|
|
||||||
## Invida potest in oleis
|
|
||||||
|
|
||||||
Foret vitae in ensis profanus, pia cum procul, de septem _exstat_. Interdum
|
|
||||||
_revocamina_ datis divulsere: tenentem **sustinet cervice cursus**, populo,
|
|
||||||
parentem virorum. Freta et odit mitius hostem solitas carmine mihi non in
|
|
||||||
classe, ab dixerat perque caperet inclusum furialibus nunc.
|
|
||||||
|
|
||||||
1. Pretium feris ictus horto certamina quem alteraque
|
|
||||||
2. Stantes tutaeque iussit tenet
|
|
||||||
3. Discordia Dianae agmen inque
|
|
||||||
|
|
||||||
## Percussit Latonia
|
|
||||||
|
|
||||||
Socii ululasse inquiri lumina, sum Aeolides cecinisse Nonacria habent exigui
|
|
||||||
inque **et** silvae trementi conplexa dextraeque, ut. Iunctura volumina venisse
|
|
||||||
imagine tumidum: **frequentat** dum dolor positae sponsa extemplo magnos Nestor
|
|
||||||
et limenque: nunc effetum certe.
|
|
||||||
|
|
||||||
Dicta spectare arbitrium feres: coniungere imperat puero perdere steterat
|
|
||||||
temperat me umbramque. Altera est Iovis iam, praeduraque rector atque cara,
|
|
||||||
canities. Cervicibus certeque quid propioraque adest genuisse pectore cuius
|
|
||||||
petit, dignare. Et meorum effugiam socer, _nunc_ vel, feris artus merum videri.
|
|
||||||
Et videt lora sacras cursu furta quas pro onerata Maeandros, amori soleat apri
|
|
||||||
pendebat vetitum, ex crescentemque usus?
|
|
||||||
|
|
||||||
Dei cede campoque vel Pallas pererrat ante meo. [Quisque
|
|
||||||
quamquam](http://nudare.org/vindexque-dilexit) tempus, erat molis a feror
|
|
||||||
marmore ut Zephyro [contentus vanis](http://aequor.org/qui). _Puto res_
|
|
||||||
cervicibus vires benefacta neque rigidas attonitus fumabant alta, accipe
|
|
||||||
habitataque vacuus. Mea tenere, vulgata, te adspexit, in interdum bibebatur
|
|
||||||
debet Dictys te fugit te quoque! Orbem gerit prius altae nec quid irae Cinyras
|
|
||||||
Anguemque iacent; cum hoc qui ubi.
|
|
@ -1,4 +0,0 @@
|
|||||||
- name: Anson Biggs
|
|
||||||
twitter: Anson_3D
|
|
||||||
photo: '.jpg'
|
|
||||||
url: https://www.linkedin.com/in/ansonbiggs/
|
|
@ -1,2 +0,0 @@
|
|||||||
name: Anson Biggs
|
|
||||||
url: https://www.linkedin.com/in/ansonbiggs/
|
|
@ -1,10 +0,0 @@
|
|||||||
- item: About
|
|
||||||
url: about/
|
|
||||||
- item: Blog
|
|
||||||
url: ""
|
|
||||||
- item: Category A
|
|
||||||
url: categories/development/
|
|
||||||
- item: Category B
|
|
||||||
url: categories/golang/
|
|
||||||
- item: Tag B
|
|
||||||
url: tags/go/
|
|
35
blog/pelicanconf.py
Normal file
35
blog/pelicanconf.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*- #
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
AUTHOR = 'Anson Biggs'
|
||||||
|
SITENAME = 'Anson 3D'
|
||||||
|
SITEURL = ''
|
||||||
|
|
||||||
|
PATH = 'content'
|
||||||
|
|
||||||
|
TIMEZONE = 'America/Phoenix'
|
||||||
|
|
||||||
|
DEFAULT_LANG = 'English'
|
||||||
|
|
||||||
|
# Feed generation is usually not desired when developing
|
||||||
|
FEED_ALL_ATOM = None
|
||||||
|
CATEGORY_FEED_ATOM = None
|
||||||
|
TRANSLATION_FEED_ATOM = None
|
||||||
|
AUTHOR_FEED_ATOM = None
|
||||||
|
AUTHOR_FEED_RSS = None
|
||||||
|
|
||||||
|
# Blogroll
|
||||||
|
LINKS = (('Pelican', 'http://getpelican.com/'),
|
||||||
|
('Python.org', 'http://python.org/'),
|
||||||
|
('Jinja2', 'http://jinja.pocoo.org/'),
|
||||||
|
('You can modify those links in your config file', '#'),)
|
||||||
|
|
||||||
|
# Social widget
|
||||||
|
SOCIAL = (('You can add links in your config file', '#'),
|
||||||
|
('Another social link', '#'),)
|
||||||
|
|
||||||
|
DEFAULT_PAGINATION = False
|
||||||
|
|
||||||
|
# Uncomment following line if you want document-relative URLs when developing
|
||||||
|
#RELATIVE_URLS = True
|
25
blog/publishconf.py
Normal file
25
blog/publishconf.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*- #
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
# This file is only used if you use `make publish` or
|
||||||
|
# explicitly specify it as your config file.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
sys.path.append(os.curdir)
|
||||||
|
from pelicanconf import *
|
||||||
|
|
||||||
|
# If your site is available via HTTPS, make sure SITEURL begins with https://
|
||||||
|
SITEURL = ''
|
||||||
|
RELATIVE_URLS = False
|
||||||
|
|
||||||
|
FEED_ALL_ATOM = 'feeds/all.atom.xml'
|
||||||
|
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml'
|
||||||
|
|
||||||
|
DELETE_OUTPUT_DIRECTORY = True
|
||||||
|
|
||||||
|
# Following items are often useful when publishing
|
||||||
|
|
||||||
|
#DISQUS_SITENAME = ""
|
||||||
|
#GOOGLE_ANALYTICS = ""
|
@ -1,339 +0,0 @@
|
|||||||
function createEl(element) {
|
|
||||||
return document.createElement(element);
|
|
||||||
}
|
|
||||||
|
|
||||||
function elem(selector, parent = document){
|
|
||||||
let elem = document.querySelector(selector);
|
|
||||||
return elem != false ? elem : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function elems(selector) {
|
|
||||||
let elems = document.querySelectorAll(selector);
|
|
||||||
return elems.length ? elems : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function pushClass(el, targetClass) {
|
|
||||||
// equivalent to addClass
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? false : elClass.add(targetClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteClass(el, targetClass) {
|
|
||||||
// equivalent to removeClass
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? elClass.remove(targetClass) : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function modifyClass(el, targetClass) {
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? elClass.remove(targetClass) : elClass.add(targetClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function containsClass(el, targetClass) {
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
return el.classList.contains(targetClass) ? true : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isChild(node, parentClass) {
|
|
||||||
let objectsAreValid = node && typeof node == 'object' && parentClass && typeof parentClass == 'string';
|
|
||||||
return (objectsAreValid && node.closest(parentClass)) ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
(function updateDate() {
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
elem('.year').innerHTML = year;
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
let bar = 'nav_bar-wrap';
|
|
||||||
let navBar = elem(`.${bar}`);
|
|
||||||
let nav = elem('.nav-body');
|
|
||||||
let open = 'nav-open';
|
|
||||||
let exit = 'nav-exit';
|
|
||||||
let drop = 'nav-drop';
|
|
||||||
let pop = 'nav-pop';
|
|
||||||
let navDrop = elem(`.${drop}`);
|
|
||||||
let hidden = 'hidden';
|
|
||||||
|
|
||||||
function toggleMenu(){
|
|
||||||
modifyClass(navDrop, pop);
|
|
||||||
modifyClass(navBar, hidden);
|
|
||||||
let menuOpen = containsClass(nav, open);
|
|
||||||
let menuPulled = containsClass(nav, exit);
|
|
||||||
|
|
||||||
let status = menuOpen || menuPulled ? true : false;
|
|
||||||
|
|
||||||
status ? modifyClass(nav, exit) : modifyClass(nav, open);
|
|
||||||
status ? modifyClass(nav, open) : modifyClass(nav, exit);
|
|
||||||
}
|
|
||||||
|
|
||||||
// $('.nav-bar, .nav-close').on('click', () => toggleMenu());
|
|
||||||
navBar.addEventListener('click', function() {
|
|
||||||
toggleMenu();
|
|
||||||
});
|
|
||||||
elem('.nav-close').addEventListener('click', function() {
|
|
||||||
toggleMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
elem('.nav-drop').addEventListener('click', function(e) {
|
|
||||||
e.target === this ? toggleMenu() : false;
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function share(){
|
|
||||||
let share = elem('.share');
|
|
||||||
let open = 'share-open';
|
|
||||||
let close = 'share-close';
|
|
||||||
let button = elem('.share-trigger');
|
|
||||||
|
|
||||||
function showShare() {
|
|
||||||
pushClass(share, open);
|
|
||||||
deleteClass(share, close);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideShare() {
|
|
||||||
pushClass(share, open);
|
|
||||||
deleteClass(share, close);
|
|
||||||
}
|
|
||||||
if (button) {
|
|
||||||
button.addEventListener('click', function() {
|
|
||||||
showShare();
|
|
||||||
setTimeout(hideShare, 5000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function comments(){
|
|
||||||
|
|
||||||
let comments = elem('.js-comments');
|
|
||||||
let form = elem('.form');
|
|
||||||
let body = elem('body');
|
|
||||||
let button = elem('.form_toggle');
|
|
||||||
let loading = 'form-loading';
|
|
||||||
let open = 'form-open';
|
|
||||||
let show = 'modal_show'
|
|
||||||
let toggled = 'toggled';
|
|
||||||
|
|
||||||
let successOutput = [
|
|
||||||
'Review submitted',
|
|
||||||
'Thanks for your review! It will show on the site once it has been approved.'
|
|
||||||
];
|
|
||||||
|
|
||||||
let errorOutput = [
|
|
||||||
'Error',
|
|
||||||
'Sorry, there was an error with the submission!'
|
|
||||||
];
|
|
||||||
|
|
||||||
function handleForm(form) {
|
|
||||||
form.addEventListener('submit', function (event) {
|
|
||||||
pushClass(form, loading);
|
|
||||||
|
|
||||||
function resetForm() {
|
|
||||||
deleteClass(form, loading);
|
|
||||||
// $("form").trigger("reset");
|
|
||||||
}
|
|
||||||
|
|
||||||
function formActions(message) {
|
|
||||||
showModal(...message) // array destructuring
|
|
||||||
resetForm();
|
|
||||||
}
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
function formToJSON(obj) {
|
|
||||||
let rawData = Array.from(obj.elements);
|
|
||||||
let data = {};
|
|
||||||
rawData.forEach(function(element){
|
|
||||||
data[element.name] = element.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
return JSON.stringify(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
let data = formToJSON(form);
|
|
||||||
let url = form.getAttribute('action').trim();
|
|
||||||
fetch(url, {
|
|
||||||
method: "POST",
|
|
||||||
body: data,
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}).then(function(res) {
|
|
||||||
if(res.ok) {
|
|
||||||
formActions(successOutput);
|
|
||||||
} else {
|
|
||||||
formActions(errorOutput);
|
|
||||||
}
|
|
||||||
}).catch(function(error) {
|
|
||||||
formActions(errorOutput);
|
|
||||||
console.error('Error:', error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
form ? handleForm(form) : false;
|
|
||||||
function closeModal() {
|
|
||||||
elem('.modal_close').addEventListener('click', function () {
|
|
||||||
deleteClass(body, show);
|
|
||||||
deleteClass(form, loading);
|
|
||||||
deleteClass(form, open);
|
|
||||||
deleteClass(button, toggled);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
containsClass(body, show) ? closeModal() : false;
|
|
||||||
|
|
||||||
function showModal(title, message) {
|
|
||||||
elem('.modal_title').textContent = title;
|
|
||||||
elem('.modal_text').innerHTML = message;
|
|
||||||
|
|
||||||
pushClass(body, show);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
(function toggleForm() {
|
|
||||||
if(button) {
|
|
||||||
button.addEventListener('click', function() {
|
|
||||||
modifyClass(form, open);
|
|
||||||
modifyClass(this, toggled);
|
|
||||||
this.textContent = containsClass(this, toggled) ? 'cancel' : 'comment';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
function elemAttribute(elem, attr, value = null) {
|
|
||||||
if (value) {
|
|
||||||
elem.setAttribute(attr, value);
|
|
||||||
} else {
|
|
||||||
value = elem.getAttribute(attr);
|
|
||||||
return value ? value : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(function(){
|
|
||||||
let links = document.querySelectorAll('a');
|
|
||||||
if(links) {
|
|
||||||
Array.from(links).forEach(function(link){
|
|
||||||
let target, rel, blank, noopener, attr1, attr2, url, isExternal;
|
|
||||||
url = elemAttribute(link, 'href');
|
|
||||||
isExternal = (url && typeof url == 'string' && url.startsWith('http')) && !containsClass(link, 'nav_item') && !isChild(link, '.post_item') && !isChild(link, '.pager') ? true : false;
|
|
||||||
if(isExternal) {
|
|
||||||
target = 'target';
|
|
||||||
rel = 'rel';
|
|
||||||
blank = '_blank';
|
|
||||||
noopener = 'noopener';
|
|
||||||
attr1 = elemAttribute(link, target);
|
|
||||||
attr2 = elemAttribute(link, noopener);
|
|
||||||
|
|
||||||
attr1 ? false : elemAttribute(link, target, blank);
|
|
||||||
attr2 ? false : elemAttribute(link, noopener, noopener);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
let headingNodes = [], results, link, icon, current, id,
|
|
||||||
tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
|
||||||
|
|
||||||
|
|
||||||
current = document.URL;
|
|
||||||
|
|
||||||
tags.forEach(function(tag){
|
|
||||||
results = document.getElementsByTagName(tag);
|
|
||||||
Array.prototype.push.apply(headingNodes, results);
|
|
||||||
});
|
|
||||||
|
|
||||||
headingNodes.forEach(function(node){
|
|
||||||
link = createEl('a');
|
|
||||||
icon = createEl('img');
|
|
||||||
icon.src = 'http://localhost:1313/images/icons/link.svg';
|
|
||||||
link.className = 'link';
|
|
||||||
link.appendChild(icon);
|
|
||||||
id = node.getAttribute('id');
|
|
||||||
if(id) {
|
|
||||||
link.href = `${current}#${id}`;
|
|
||||||
node.appendChild(link);
|
|
||||||
pushClass(node, 'link_owner');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const copyToClipboard = str => {
|
|
||||||
// Create a <textarea> element
|
|
||||||
const el = createEl('textarea');
|
|
||||||
// Set its value to the string that you want copied
|
|
||||||
el.value = str;
|
|
||||||
// Make it readonly to be tamper-proof
|
|
||||||
el.setAttribute('readonly', '');
|
|
||||||
// Move outside the screen to make it invisible
|
|
||||||
el.style.position = 'absolute';
|
|
||||||
el.style.left = '-9999px';
|
|
||||||
// Append the <textarea> element to the HTML document
|
|
||||||
document.body.appendChild(el);
|
|
||||||
// Check if there is any content selected previously
|
|
||||||
const selected =
|
|
||||||
document.getSelection().rangeCount > 0
|
|
||||||
? document.getSelection().getRangeAt(0) // Store selection if found
|
|
||||||
: false; // Mark as false to know no selection existed before
|
|
||||||
el.select(); // Select the <textarea> content
|
|
||||||
document.execCommand('copy'); // Copy - only works as a result of a user action (e.g. click events)
|
|
||||||
document.body.removeChild(el); // Remove the <textarea> element
|
|
||||||
if (selected) { // If a selection existed before copying
|
|
||||||
document.getSelection().removeAllRanges(); // Unselect everything on the HTML document
|
|
||||||
document.getSelection().addRange(selected); // Restore the original selection
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(function copyHeadingLink() {
|
|
||||||
let deeplinks = document.querySelectorAll;
|
|
||||||
let deeplink = 'link';
|
|
||||||
if(deeplinks) {
|
|
||||||
document.body.addEventListener('click', function(event)
|
|
||||||
{
|
|
||||||
let target = event.target;
|
|
||||||
if (target.classList.contains(deeplink) || target.parentNode.classList.contains(deeplink)) {
|
|
||||||
event.preventDefault();
|
|
||||||
let newLink = target.href != undefined ? target.href : target.parentNode.href;
|
|
||||||
copyToClipboard(newLink);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function copyLinkToShare() {
|
|
||||||
let copy, copied, excerpt, isCopyIcon, isInExcerpt, link, page, postCopy, postLink, target;
|
|
||||||
copy = 'copy';
|
|
||||||
copied = 'copy_done';
|
|
||||||
excerpt = 'excerpt';
|
|
||||||
postCopy = 'post_copy';
|
|
||||||
postLink = 'post_card';
|
|
||||||
page = document.documentElement;
|
|
||||||
|
|
||||||
page.addEventListener('click', function(event) {
|
|
||||||
target = event.target;
|
|
||||||
isCopyIcon = containsClass(target, copy);
|
|
||||||
isInExcerpt = containsClass(target, postCopy);
|
|
||||||
if (isCopyIcon) {
|
|
||||||
if (isInExcerpt) {
|
|
||||||
link = target.closest(`.${excerpt}`).previousElementSibling;
|
|
||||||
link = containsClass(link, postLink)? elemAttribute(link, 'href') : false;
|
|
||||||
} else {
|
|
||||||
link = window.location.href;
|
|
||||||
}
|
|
||||||
if(link) {
|
|
||||||
copyToClipboard(link);
|
|
||||||
pushClass(target, copied);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
@ -1 +0,0 @@
|
|||||||
{"Target":"js/index.js","MediaType":"application/javascript","Data":{}}
|
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
{"Target":"css/main.29dc3cd97cc444f2814115c9e14cecf81ae89bf0ef85d08d7a9b02cc04e56d9169671a3a54273ea3b291d4711acacb9223000408296836c54503375f68dd5bf2.css","MediaType":"text/css","Data":{"Integrity":"sha512-Kdw82XzERPKBQRXJ4Uzs+Brom/DvhdCNepsCzATlbZFpZxo6VCc+o7KR1HEaysuSIwAECCloNsVFAzdfaN1b8g=="}}
|
|
119
blog/tasks.py
Normal file
119
blog/tasks.py
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import sys
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
from invoke import task
|
||||||
|
from invoke.util import cd
|
||||||
|
from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer
|
||||||
|
from pelican.settings import DEFAULT_CONFIG, get_settings_from_file
|
||||||
|
|
||||||
|
SETTINGS_FILE_BASE = 'pelicanconf.py'
|
||||||
|
SETTINGS = {}
|
||||||
|
SETTINGS.update(DEFAULT_CONFIG)
|
||||||
|
LOCAL_SETTINGS = get_settings_from_file(SETTINGS_FILE_BASE)
|
||||||
|
SETTINGS.update(LOCAL_SETTINGS)
|
||||||
|
|
||||||
|
CONFIG = {
|
||||||
|
'settings_base': SETTINGS_FILE_BASE,
|
||||||
|
'settings_publish': 'publishconf.py',
|
||||||
|
# Output path. Can be absolute or relative to tasks.py. Default: 'output'
|
||||||
|
'deploy_path': SETTINGS['OUTPUT_PATH'],
|
||||||
|
# Github Pages configuration
|
||||||
|
'github_pages_branch': 'master',
|
||||||
|
'commit_message': "'Publish site on {}'".format(datetime.date.today().isoformat()),
|
||||||
|
# Port for `serve`
|
||||||
|
'port': 8000,
|
||||||
|
}
|
||||||
|
|
||||||
|
@task
|
||||||
|
def clean(c):
|
||||||
|
"""Remove generated files"""
|
||||||
|
if os.path.isdir(CONFIG['deploy_path']):
|
||||||
|
shutil.rmtree(CONFIG['deploy_path'])
|
||||||
|
os.makedirs(CONFIG['deploy_path'])
|
||||||
|
|
||||||
|
@task
|
||||||
|
def build(c):
|
||||||
|
"""Build local version of site"""
|
||||||
|
c.run('pelican -s {settings_base}'.format(**CONFIG))
|
||||||
|
|
||||||
|
@task
|
||||||
|
def rebuild(c):
|
||||||
|
"""`build` with the delete switch"""
|
||||||
|
c.run('pelican -d -s {settings_base}'.format(**CONFIG))
|
||||||
|
|
||||||
|
@task
|
||||||
|
def regenerate(c):
|
||||||
|
"""Automatically regenerate site upon file modification"""
|
||||||
|
c.run('pelican -r -s {settings_base}'.format(**CONFIG))
|
||||||
|
|
||||||
|
@task
|
||||||
|
def serve(c):
|
||||||
|
"""Serve site at http://localhost:$PORT/ (default port is 8000)"""
|
||||||
|
|
||||||
|
class AddressReuseTCPServer(RootedHTTPServer):
|
||||||
|
allow_reuse_address = True
|
||||||
|
|
||||||
|
server = AddressReuseTCPServer(
|
||||||
|
CONFIG['deploy_path'],
|
||||||
|
('', CONFIG['port']),
|
||||||
|
ComplexHTTPRequestHandler)
|
||||||
|
|
||||||
|
sys.stderr.write('Serving on port {port} ...\n'.format(**CONFIG))
|
||||||
|
server.serve_forever()
|
||||||
|
|
||||||
|
@task
|
||||||
|
def reserve(c):
|
||||||
|
"""`build`, then `serve`"""
|
||||||
|
build(c)
|
||||||
|
serve(c)
|
||||||
|
|
||||||
|
@task
|
||||||
|
def preview(c):
|
||||||
|
"""Build production version of site"""
|
||||||
|
c.run('pelican -s {settings_publish}'.format(**CONFIG))
|
||||||
|
|
||||||
|
@task
|
||||||
|
def livereload(c):
|
||||||
|
"""Automatically reload browser tab upon file modification."""
|
||||||
|
from livereload import Server
|
||||||
|
build(c)
|
||||||
|
server = Server()
|
||||||
|
# Watch the base settings file
|
||||||
|
server.watch(CONFIG['settings_base'], lambda: build(c))
|
||||||
|
# Watch content source files
|
||||||
|
content_file_extensions = ['.md', '.rst']
|
||||||
|
for extension in content_file_extensions:
|
||||||
|
content_blob = '{0}/**/*{1}'.format(SETTINGS['PATH'], extension)
|
||||||
|
server.watch(content_blob, lambda: build(c))
|
||||||
|
# Watch the theme's templates and static assets
|
||||||
|
theme_path = SETTINGS['THEME']
|
||||||
|
server.watch('{}/templates/*.html'.format(theme_path), lambda: build(c))
|
||||||
|
static_file_extensions = ['.css', '.js']
|
||||||
|
for extension in static_file_extensions:
|
||||||
|
static_file = '{0}/static/**/*{1}'.format(theme_path, extension)
|
||||||
|
server.watch(static_file, lambda: build(c))
|
||||||
|
# Serve output path on configured port
|
||||||
|
server.serve(port=CONFIG['port'], root=CONFIG['deploy_path'])
|
||||||
|
|
||||||
|
|
||||||
|
@task
|
||||||
|
def publish(c):
|
||||||
|
"""Publish to production via rsync"""
|
||||||
|
c.run('pelican -s {settings_publish}'.format(**CONFIG))
|
||||||
|
c.run(
|
||||||
|
'rsync --delete --exclude ".DS_Store" -pthrvz -c '
|
||||||
|
'{} {production}:{dest_path}'.format(
|
||||||
|
CONFIG['deploy_path'].rstrip('/') + '/',
|
||||||
|
**CONFIG))
|
||||||
|
|
||||||
|
@task
|
||||||
|
def gh_pages(c):
|
||||||
|
"""Publish to GitHub Pages"""
|
||||||
|
preview(c)
|
||||||
|
c.run('ghp-import -b {github_pages_branch} '
|
||||||
|
'-m {commit_message} '
|
||||||
|
'{deploy_path} -p'.format(**CONFIG))
|
3
blog/themes/hugo-swift-theme/.gitignore
vendored
3
blog/themes/hugo-swift-theme/.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
public
|
|
||||||
docs
|
|
||||||
.DS_Store
|
|
@ -1,28 +0,0 @@
|
|||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2014 Steve Francia
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
Staticman's reCAPTCHA support
|
|
||||||
=================================================================================
|
|
||||||
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Original work Copyright (c) 2019 Praveen Lobo and Munif Tanjim
|
|
@ -1,102 +0,0 @@
|
|||||||
## Swift Theme
|
|
||||||
This theme is designed for blogging purposes. Feel free to extend it for other use cases though.
|
|
||||||
|
|
||||||
At its core, it's minimalistic; it doesn't rely on monolithic libraries such e.g jquery, bootstrap. Instead, it uses *grid css*, *flexbox* & *vanilla js* to facilitate the `features` outlined below:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Features
|
|
||||||
* Blog
|
|
||||||
* Pagination
|
|
||||||
* Responsive
|
|
||||||
* Deeplinks
|
|
||||||
* Dark Mode
|
|
||||||
* Syntax Highlighting
|
|
||||||
* [Staticman](https://staticman.net)
|
|
||||||
* [reCAPTCHA](https://developers.google.com/recaptcha/docs/display)
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
Add this theme as a Git submodule inside your Hugo site folder:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ git submodule add https://github.com/onweru/hugo-swift-theme.git themes/hugo-swift-theme
|
|
||||||
```
|
|
||||||
|
|
||||||
> Theme hugo sass and hugo-extended version.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
You can configure the site using as follows:
|
|
||||||
1. **General Information** and **Staticman config**
|
|
||||||
|
|
||||||
Use the file `config.toml`.
|
|
||||||
|
|
||||||
2. **menu**, **footer**
|
|
||||||
|
|
||||||
See the **data** files inside the `data/` directory.
|
|
||||||
|
|
||||||
> Follow the `exampleSite/`.
|
|
||||||
|
|
||||||
## Staticman Comments
|
|
||||||
By default, [Staticman](https://staticman.net) comments are disabled. If you would like to enable them,
|
|
||||||
|
|
||||||
1. Invite Staticman to your repo to collaborate.
|
|
||||||
|
|
||||||
- GitHub: View the issue [eduardoboucas/staticman#243](https://github.com/eduardoboucas/staticman/issues/243) for procedures to set up Staticman v3.
|
|
||||||
- GitLab: Add the GitLab user associated with your Staticman API endpoint (e.g. **[@staticmanlab](https://gitlab.com/staticmanlab)**) as a "**developer**" for your project by going to **Settings → Members → Invite member**.
|
|
||||||
- Framagit: Since Framagit is a fork of GitLab, the overall setup is similar to that on GitLab. (Note that the Framagit bot is named as **[@staticmanlab1](https://framagit.org/staticmanlab1)**.)
|
|
||||||
|
|
||||||
2. Uncomment the `[Params.staticman]` section and input the parameters inside `config.toml` like so
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[Params.staticman]
|
|
||||||
endpoint = "https://api.staticman.net"
|
|
||||||
gitProvider = "github"
|
|
||||||
username = "your-username"
|
|
||||||
repository = "hugo-swift-theme"
|
|
||||||
branch = "master"
|
|
||||||
```
|
|
||||||
|
|
||||||
In case of empty `endpoint`, it will fallback to the official production instance.
|
|
||||||
|
|
||||||
| instance | `endpoint` |
|
|
||||||
| --- | --- |
|
|
||||||
| official production | `https://api.staticman.net` |
|
|
||||||
| GitLab | `https://staticman3.herokuapp.com` |
|
|
||||||
| Framagit | `https://staticman-frama.herokuapp.com` |
|
|
||||||
|
|
||||||
Remark: You may adjust the `endpoint` to the one that your Staticman bot/GitHub App is associated with.
|
|
||||||
|
|
||||||
For `gitProvider`, you can choose either `github` or `gitlab`. If you're using Framagit, choose `gitlab`.
|
|
||||||
|
|
||||||
3. Proceed to setup `staticman.yml`. Note that this YML file has to be **at the root of your Git repository**. See the `exampleSite/` and the [Staticman docs](https://staticman.net/docs/) for detailed information of each parameter used in this YML file.
|
|
||||||
|
|
||||||
The parameter `moderation` is for comment moderation, and it defaults to `false`. If it is switched to `true`, then Staticman will create a pull/merge request instead of directly committing against the `branch`.
|
|
||||||
|
|
||||||
If you are working on GitLab and you have set `moderation: false`, depending on your `branch`, you might need the following steps.
|
|
||||||
|
|
||||||
- protected branch (e.g. `master`):
|
|
||||||
Go to **Settings → Repository → Protected Branches** and permit the GitLab bot to push against that branch.
|
|
||||||
- unprotected branch (GitHub's default): no measures needed
|
|
||||||
|
|
||||||
Optional: It is suggested to enable [reCAPTCHA](https://developers.google.com/recaptcha/docs/display) to avoid massive spam comments. You may refer to `_config.yml` for detailed instructions.
|
|
||||||
|
|
||||||
Optional: You may want to configure a webhook to prevent old inactive branches (representing approved comments) from stacking up. You can refer to [Staticman's documentation](https://staticman.net/docs/webhooks) for details. Make sure to input the **Payload URL** according to your chosen `endpoint`. For example, the default `endpoint` is `https://staticman3.herokuapp.com`, so the corresponding **Payload URL** should be `https://staticman3.herokuapp.com/v1/webhook`.
|
|
||||||
|
|
||||||
:information_source: This [Binary Mist article](https://binarymist.io/blog/2018/02/24/hugo-with-staticman-commenting-and-subscriptions/) could also be quite helpful :)
|
|
||||||
|
|
||||||
:information_source: By default, this theme uses the official production instance at v3 instead of v2 due to a requests' quota issue reported in issue [eduardoboucas/staticman#222](https://github.com/eduardoboucas/staticman/issues/222).
|
|
||||||
|
|
||||||
:warning: Since Staticman is an evolving project, things might work differently than they do at the moment of this writing.
|
|
||||||
|
|
||||||
### Deeplinks
|
|
||||||
|
|
||||||
For all content published using markdown, deeplinks will be added to the pages so that you can share with precision :smiley: Just hover on a heading and the link button will pop. Click it to copy.
|
|
||||||
|
|
||||||
### Dark Mode
|
|
||||||
|
|
||||||
Today most operating systems & browsers support dark mode. Like twitter, which automatically turns into dark mode when the user chooses darkmode, this theme does the same thing.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## License
|
|
||||||
The code is available under the [MIT license](https://github.com/onweru/hugo-swift-theme/blob/master/LICENSE.md).
|
|
@ -1,339 +0,0 @@
|
|||||||
function createEl(element) {
|
|
||||||
return document.createElement(element);
|
|
||||||
}
|
|
||||||
|
|
||||||
function elem(selector, parent = document){
|
|
||||||
let elem = document.querySelector(selector);
|
|
||||||
return elem != false ? elem : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function elems(selector) {
|
|
||||||
let elems = document.querySelectorAll(selector);
|
|
||||||
return elems.length ? elems : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function pushClass(el, targetClass) {
|
|
||||||
// equivalent to addClass
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? false : elClass.add(targetClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteClass(el, targetClass) {
|
|
||||||
// equivalent to removeClass
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? elClass.remove(targetClass) : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function modifyClass(el, targetClass) {
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? elClass.remove(targetClass) : elClass.add(targetClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function containsClass(el, targetClass) {
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
return el.classList.contains(targetClass) ? true : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isChild(node, parentClass) {
|
|
||||||
let objectsAreValid = node && typeof node == 'object' && parentClass && typeof parentClass == 'string';
|
|
||||||
return (objectsAreValid && node.closest(parentClass)) ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
(function updateDate() {
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
elem('.year').innerHTML = year;
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
let bar = 'nav_bar-wrap';
|
|
||||||
let navBar = elem(`.${bar}`);
|
|
||||||
let nav = elem('.nav-body');
|
|
||||||
let open = 'nav-open';
|
|
||||||
let exit = 'nav-exit';
|
|
||||||
let drop = 'nav-drop';
|
|
||||||
let pop = 'nav-pop';
|
|
||||||
let navDrop = elem(`.${drop}`);
|
|
||||||
let hidden = 'hidden';
|
|
||||||
|
|
||||||
function toggleMenu(){
|
|
||||||
modifyClass(navDrop, pop);
|
|
||||||
modifyClass(navBar, hidden);
|
|
||||||
let menuOpen = containsClass(nav, open);
|
|
||||||
let menuPulled = containsClass(nav, exit);
|
|
||||||
|
|
||||||
let status = menuOpen || menuPulled ? true : false;
|
|
||||||
|
|
||||||
status ? modifyClass(nav, exit) : modifyClass(nav, open);
|
|
||||||
status ? modifyClass(nav, open) : modifyClass(nav, exit);
|
|
||||||
}
|
|
||||||
|
|
||||||
// $('.nav-bar, .nav-close').on('click', () => toggleMenu());
|
|
||||||
navBar.addEventListener('click', function() {
|
|
||||||
toggleMenu();
|
|
||||||
});
|
|
||||||
elem('.nav-close').addEventListener('click', function() {
|
|
||||||
toggleMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
elem('.nav-drop').addEventListener('click', function(e) {
|
|
||||||
e.target === this ? toggleMenu() : false;
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function share(){
|
|
||||||
let share = elem('.share');
|
|
||||||
let open = 'share-open';
|
|
||||||
let close = 'share-close';
|
|
||||||
let button = elem('.share-trigger');
|
|
||||||
|
|
||||||
function showShare() {
|
|
||||||
pushClass(share, open);
|
|
||||||
deleteClass(share, close);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideShare() {
|
|
||||||
pushClass(share, open);
|
|
||||||
deleteClass(share, close);
|
|
||||||
}
|
|
||||||
if (button) {
|
|
||||||
button.addEventListener('click', function() {
|
|
||||||
showShare();
|
|
||||||
setTimeout(hideShare, 5000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function comments(){
|
|
||||||
|
|
||||||
let comments = elem('.js-comments');
|
|
||||||
let form = elem('.form');
|
|
||||||
let body = elem('body');
|
|
||||||
let button = elem('.form_toggle');
|
|
||||||
let loading = 'form-loading';
|
|
||||||
let open = 'form-open';
|
|
||||||
let show = 'modal_show'
|
|
||||||
let toggled = 'toggled';
|
|
||||||
|
|
||||||
let successOutput = [
|
|
||||||
'Review submitted',
|
|
||||||
'Thanks for your review! It will show on the site once it has been approved.'
|
|
||||||
];
|
|
||||||
|
|
||||||
let errorOutput = [
|
|
||||||
'Error',
|
|
||||||
'Sorry, there was an error with the submission!'
|
|
||||||
];
|
|
||||||
|
|
||||||
function handleForm(form) {
|
|
||||||
form.addEventListener('submit', function (event) {
|
|
||||||
pushClass(form, loading);
|
|
||||||
|
|
||||||
function resetForm() {
|
|
||||||
deleteClass(form, loading);
|
|
||||||
// $("form").trigger("reset");
|
|
||||||
}
|
|
||||||
|
|
||||||
function formActions(message) {
|
|
||||||
showModal(...message) // array destructuring
|
|
||||||
resetForm();
|
|
||||||
}
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
function formToJSON(obj) {
|
|
||||||
let rawData = Array.from(obj.elements);
|
|
||||||
let data = {};
|
|
||||||
rawData.forEach(function(element){
|
|
||||||
data[element.name] = element.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
return JSON.stringify(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
let data = formToJSON(form);
|
|
||||||
let url = form.getAttribute('action').trim();
|
|
||||||
fetch(url, {
|
|
||||||
method: "POST",
|
|
||||||
body: data,
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}).then(function(res) {
|
|
||||||
if(res.ok) {
|
|
||||||
formActions(successOutput);
|
|
||||||
} else {
|
|
||||||
formActions(errorOutput);
|
|
||||||
}
|
|
||||||
}).catch(function(error) {
|
|
||||||
formActions(errorOutput);
|
|
||||||
console.error('Error:', error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
form ? handleForm(form) : false;
|
|
||||||
function closeModal() {
|
|
||||||
elem('.modal_close').addEventListener('click', function () {
|
|
||||||
deleteClass(body, show);
|
|
||||||
deleteClass(form, loading);
|
|
||||||
deleteClass(form, open);
|
|
||||||
deleteClass(button, toggled);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
containsClass(body, show) ? closeModal() : false;
|
|
||||||
|
|
||||||
function showModal(title, message) {
|
|
||||||
elem('.modal_title').textContent = title;
|
|
||||||
elem('.modal_text').innerHTML = message;
|
|
||||||
|
|
||||||
pushClass(body, show);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
(function toggleForm() {
|
|
||||||
if(button) {
|
|
||||||
button.addEventListener('click', function() {
|
|
||||||
modifyClass(form, open);
|
|
||||||
modifyClass(this, toggled);
|
|
||||||
this.textContent = containsClass(this, toggled) ? 'cancel' : 'comment';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
function elemAttribute(elem, attr, value = null) {
|
|
||||||
if (value) {
|
|
||||||
elem.setAttribute(attr, value);
|
|
||||||
} else {
|
|
||||||
value = elem.getAttribute(attr);
|
|
||||||
return value ? value : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(function(){
|
|
||||||
let links = document.querySelectorAll('a');
|
|
||||||
if(links) {
|
|
||||||
Array.from(links).forEach(function(link){
|
|
||||||
let target, rel, blank, noopener, attr1, attr2, url, isExternal;
|
|
||||||
url = elemAttribute(link, 'href');
|
|
||||||
isExternal = (url && typeof url == 'string' && url.startsWith('http')) && !containsClass(link, 'nav_item') && !isChild(link, '.post_item') && !isChild(link, '.pager') ? true : false;
|
|
||||||
if(isExternal) {
|
|
||||||
target = 'target';
|
|
||||||
rel = 'rel';
|
|
||||||
blank = '_blank';
|
|
||||||
noopener = 'noopener';
|
|
||||||
attr1 = elemAttribute(link, target);
|
|
||||||
attr2 = elemAttribute(link, noopener);
|
|
||||||
|
|
||||||
attr1 ? false : elemAttribute(link, target, blank);
|
|
||||||
attr2 ? false : elemAttribute(link, noopener, noopener);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
let headingNodes = [], results, link, icon, current, id,
|
|
||||||
tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
|
||||||
|
|
||||||
|
|
||||||
current = document.URL;
|
|
||||||
|
|
||||||
tags.forEach(function(tag){
|
|
||||||
results = document.getElementsByTagName(tag);
|
|
||||||
Array.prototype.push.apply(headingNodes, results);
|
|
||||||
});
|
|
||||||
|
|
||||||
headingNodes.forEach(function(node){
|
|
||||||
link = createEl('a');
|
|
||||||
icon = createEl('img');
|
|
||||||
icon.src = '{{ "images/icons/link.svg" | absURL }}';
|
|
||||||
link.className = 'link';
|
|
||||||
link.appendChild(icon);
|
|
||||||
id = node.getAttribute('id');
|
|
||||||
if(id) {
|
|
||||||
link.href = `${current}#${id}`;
|
|
||||||
node.appendChild(link);
|
|
||||||
pushClass(node, 'link_owner');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const copyToClipboard = str => {
|
|
||||||
// Create a <textarea> element
|
|
||||||
const el = createEl('textarea');
|
|
||||||
// Set its value to the string that you want copied
|
|
||||||
el.value = str;
|
|
||||||
// Make it readonly to be tamper-proof
|
|
||||||
el.setAttribute('readonly', '');
|
|
||||||
// Move outside the screen to make it invisible
|
|
||||||
el.style.position = 'absolute';
|
|
||||||
el.style.left = '-9999px';
|
|
||||||
// Append the <textarea> element to the HTML document
|
|
||||||
document.body.appendChild(el);
|
|
||||||
// Check if there is any content selected previously
|
|
||||||
const selected =
|
|
||||||
document.getSelection().rangeCount > 0
|
|
||||||
? document.getSelection().getRangeAt(0) // Store selection if found
|
|
||||||
: false; // Mark as false to know no selection existed before
|
|
||||||
el.select(); // Select the <textarea> content
|
|
||||||
document.execCommand('copy'); // Copy - only works as a result of a user action (e.g. click events)
|
|
||||||
document.body.removeChild(el); // Remove the <textarea> element
|
|
||||||
if (selected) { // If a selection existed before copying
|
|
||||||
document.getSelection().removeAllRanges(); // Unselect everything on the HTML document
|
|
||||||
document.getSelection().addRange(selected); // Restore the original selection
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(function copyHeadingLink() {
|
|
||||||
let deeplinks = document.querySelectorAll;
|
|
||||||
let deeplink = 'link';
|
|
||||||
if(deeplinks) {
|
|
||||||
document.body.addEventListener('click', function(event)
|
|
||||||
{
|
|
||||||
let target = event.target;
|
|
||||||
if (target.classList.contains(deeplink) || target.parentNode.classList.contains(deeplink)) {
|
|
||||||
event.preventDefault();
|
|
||||||
let newLink = target.href != undefined ? target.href : target.parentNode.href;
|
|
||||||
copyToClipboard(newLink);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function copyLinkToShare() {
|
|
||||||
let copy, copied, excerpt, isCopyIcon, isInExcerpt, link, page, postCopy, postLink, target;
|
|
||||||
copy = 'copy';
|
|
||||||
copied = 'copy_done';
|
|
||||||
excerpt = 'excerpt';
|
|
||||||
postCopy = 'post_copy';
|
|
||||||
postLink = 'post_card';
|
|
||||||
page = document.documentElement;
|
|
||||||
|
|
||||||
page.addEventListener('click', function(event) {
|
|
||||||
target = event.target;
|
|
||||||
isCopyIcon = containsClass(target, copy);
|
|
||||||
isInExcerpt = containsClass(target, postCopy);
|
|
||||||
if (isCopyIcon) {
|
|
||||||
if (isInExcerpt) {
|
|
||||||
link = target.closest(`.${excerpt}`).previousElementSibling;
|
|
||||||
link = containsClass(link, postLink)? elemAttribute(link, 'href') : false;
|
|
||||||
} else {
|
|
||||||
link = window.location.href;
|
|
||||||
}
|
|
||||||
if(link) {
|
|
||||||
copyToClipboard(link);
|
|
||||||
pushClass(target, copied);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
@ -1,41 +0,0 @@
|
|||||||
@keyframes showMenu{
|
|
||||||
0% {
|
|
||||||
top: 100%;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
top:0;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes hideMenu {
|
|
||||||
0% {
|
|
||||||
top: 0;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
top: 100%;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes showShare{
|
|
||||||
0% {
|
|
||||||
height: 0;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
height:initial;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes hideShare{
|
|
||||||
0% {
|
|
||||||
height: initial;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
height: 0;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
.waves {
|
|
||||||
max-width: 320px;
|
|
||||||
height: 5px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
margin: 30px auto;
|
|
||||||
}
|
|
@ -1,116 +0,0 @@
|
|||||||
*{
|
|
||||||
box-sizing: border-box;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
body, html {
|
|
||||||
scroll-behavior: smooth;
|
|
||||||
}
|
|
||||||
body{
|
|
||||||
font-family: var(--font);
|
|
||||||
background-color: var(--bg);
|
|
||||||
color: var(--text);
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 1.5;
|
|
||||||
max-width:1440px;
|
|
||||||
margin:0 auto;
|
|
||||||
position:relative;
|
|
||||||
font-kerning: normal;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
min-height: 100vh;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
a{
|
|
||||||
text-decoration: none;
|
|
||||||
color:inherit;
|
|
||||||
}
|
|
||||||
blockquote {
|
|
||||||
opacity: 0.8;
|
|
||||||
padding: 1rem;
|
|
||||||
position: relative;
|
|
||||||
quotes:'\201C''\201D''\2018''\2019';
|
|
||||||
margin: 0.75rem 0;
|
|
||||||
display: flex;
|
|
||||||
flex-flow: row wrap;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 5rem;
|
|
||||||
background-position: 50% 50%;
|
|
||||||
position: relative;
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
padding: 1px;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
background: $theme;
|
|
||||||
}
|
|
||||||
p{
|
|
||||||
padding-left: 0.5rem 0 !important;
|
|
||||||
font-size: 1.1rem !important;
|
|
||||||
width: 100%;
|
|
||||||
font-weight: 300;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
code {
|
|
||||||
white-space: pre-wrap;
|
|
||||||
word-wrap: break-word;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
h1,h2,h3,h4,h5{
|
|
||||||
font-family: inherit;
|
|
||||||
text-transform: capitalize;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: 500;
|
|
||||||
padding:5px 0;
|
|
||||||
margin:15px 0;
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
h1{
|
|
||||||
font-size:200%;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
h2{
|
|
||||||
font-size:175%;
|
|
||||||
}
|
|
||||||
h3{
|
|
||||||
font-size:150%;
|
|
||||||
}
|
|
||||||
h4{
|
|
||||||
font-size:125%;
|
|
||||||
}
|
|
||||||
h5{
|
|
||||||
font-size:120%;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
max-width: 100%;
|
|
||||||
vertical-align: middle;
|
|
||||||
height:auto;
|
|
||||||
margin:15px auto;
|
|
||||||
padding:0;
|
|
||||||
}
|
|
||||||
main{
|
|
||||||
padding-bottom: 45px;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
ul{
|
|
||||||
list-style: none;
|
|
||||||
-webkit-padding-start:0;
|
|
||||||
-moz-padding-start:0;
|
|
||||||
}
|
|
||||||
b, strong, em {
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
hr {
|
|
||||||
border: none;
|
|
||||||
padding: 0.5px;
|
|
||||||
background: var(--text);
|
|
||||||
opacity: 0.5;
|
|
||||||
margin: 1rem 0;
|
|
||||||
}
|
|
@ -1,163 +0,0 @@
|
|||||||
.form{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100%;
|
|
||||||
background: transparent;
|
|
||||||
&-comments{
|
|
||||||
height:0;
|
|
||||||
opacity: 0;
|
|
||||||
margin: 0 0 1rem;
|
|
||||||
transform: translateY(250px);
|
|
||||||
transition: opacity 0.3s ease-in , transform 0.3s ease-in;
|
|
||||||
border-radius: 0.67rem;
|
|
||||||
}
|
|
||||||
&-open{
|
|
||||||
height: initial;
|
|
||||||
transform: translateY(0);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
&_input{
|
|
||||||
margin:$padding 0;
|
|
||||||
font-size: 1rem !important;
|
|
||||||
padding: $padding $padding*1.5 !important;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
border-radius:25px;
|
|
||||||
outline: none;
|
|
||||||
transition: all 0.3s ease-out;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 480px;
|
|
||||||
box-shadow: 0 5px 15px 0 rgba(158, 174, 221, 0.2);
|
|
||||||
border: 1px solid #eee;
|
|
||||||
&:focus,
|
|
||||||
&:hover{
|
|
||||||
border:1px solid $theme;
|
|
||||||
}
|
|
||||||
&-message{
|
|
||||||
resize: none;
|
|
||||||
border-radius: 15px;
|
|
||||||
min-height: 2.5rem !important;
|
|
||||||
}
|
|
||||||
&-submit{
|
|
||||||
background-color: $theme;
|
|
||||||
color:$light;
|
|
||||||
font-size:1.25rem;
|
|
||||||
cursor: pointer;
|
|
||||||
&,
|
|
||||||
&:hover{
|
|
||||||
border:none;
|
|
||||||
}
|
|
||||||
&:hover{
|
|
||||||
background-color: lighten($theme, 5%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_label{
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
&_toggle{
|
|
||||||
@include shadow(.02);
|
|
||||||
background-color: $theme;
|
|
||||||
margin: 1rem 0;
|
|
||||||
color:$light;
|
|
||||||
display: inline-block;
|
|
||||||
width: 8rem;
|
|
||||||
padding:0.33rem 1.5rem;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.comment{
|
|
||||||
&s {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal {
|
|
||||||
display: none;
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 9999;
|
|
||||||
&_close{
|
|
||||||
margin: 25px 0;
|
|
||||||
background-color: $theme;
|
|
||||||
color:$light;
|
|
||||||
border: 0;
|
|
||||||
outline: 0;
|
|
||||||
box-shadow:0 5px 15px -2px rgba(158,174,221,0.2);
|
|
||||||
cursor: pointer;
|
|
||||||
padding:$padding/2 $padding*1.5;
|
|
||||||
}
|
|
||||||
&_inner{
|
|
||||||
width:100%;
|
|
||||||
background-color: $dark;
|
|
||||||
max-width:540px;
|
|
||||||
padding: $padding * 2.5;
|
|
||||||
box-shadow: 0 25px 40px -10px rgba(158,174,221,0.2);
|
|
||||||
color: darken($light, 10%);
|
|
||||||
}
|
|
||||||
&_show {
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
&:before {
|
|
||||||
position: absolute;
|
|
||||||
content: '';
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
z-index: 999;
|
|
||||||
background-color: rgba($light, 0.85);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_show &{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
&_title{
|
|
||||||
color: $light;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-loading:before {
|
|
||||||
content: '';
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-loading .form_spinner {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form:before {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: rgba(255, 255, 255, 0.7);
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.g-recaptcha {
|
|
||||||
display: grid;
|
|
||||||
width: 100%;
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
border-radius: 0.25rem;
|
|
||||||
margin: 1.25rem 0 1.5rem;
|
|
||||||
// box-shadow: 0 1rem 4rem rgba($dark, 0.12);
|
|
||||||
> div,
|
|
||||||
iframe {
|
|
||||||
display: grid;
|
|
||||||
width: 100% !important;
|
|
||||||
height: 74px !important;
|
|
||||||
}
|
|
||||||
iframe {
|
|
||||||
transform: scale(1.03);
|
|
||||||
padding: 0 0.75rem;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,186 +0,0 @@
|
|||||||
.intro{
|
|
||||||
margin: 4rem 0 1rem;
|
|
||||||
background: $dark;
|
|
||||||
padding: 2rem 1.5rem;
|
|
||||||
color: $light;
|
|
||||||
&_inner{
|
|
||||||
@include viewport(59rem);
|
|
||||||
margin: 0 auto;
|
|
||||||
text-align: center;
|
|
||||||
padding: 25px;
|
|
||||||
position: relative;
|
|
||||||
background-color: var(--bubble);
|
|
||||||
border-radius: 1rem;
|
|
||||||
}
|
|
||||||
&_headline{
|
|
||||||
margin: 0 auto;
|
|
||||||
font-weight: 300;
|
|
||||||
}
|
|
||||||
&_desc {
|
|
||||||
opacity: 0.8;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn{
|
|
||||||
min-width: 150px;
|
|
||||||
font-size: 1rem;
|
|
||||||
margin: 1rem 0 1.5rem;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 7.5px 12.5px;
|
|
||||||
background-color: $theme;
|
|
||||||
box-shadow: 0 1rem 4rem rgba($dark,0.5);
|
|
||||||
color: $light;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
border-radius: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gravatar{
|
|
||||||
background: $light;
|
|
||||||
width:90px;
|
|
||||||
border-radius:50%;
|
|
||||||
display:inline-block;
|
|
||||||
position: absolute;
|
|
||||||
bottom:-30px;
|
|
||||||
margin:0 10px 0 0;
|
|
||||||
@include shadow;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
aside h3{
|
|
||||||
position:relative;
|
|
||||||
margin:0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-secondary,
|
|
||||||
.user-menu{
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.right {
|
|
||||||
color: $theme;
|
|
||||||
}
|
|
||||||
section p{
|
|
||||||
text-align:left;
|
|
||||||
padding:10px 0;
|
|
||||||
}
|
|
||||||
.transparent{
|
|
||||||
padding:25px;
|
|
||||||
}
|
|
||||||
.point{
|
|
||||||
margin-right:15px;
|
|
||||||
color:$theme;
|
|
||||||
}
|
|
||||||
.wrap{
|
|
||||||
padding:30px 40px 50px 40px;
|
|
||||||
}
|
|
||||||
.hold{
|
|
||||||
position:relative;
|
|
||||||
overflow:visible;
|
|
||||||
}
|
|
||||||
.site{
|
|
||||||
&__icon{
|
|
||||||
width:40px;
|
|
||||||
margin: 0 10px 0 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media screen and (min-width: 769px){
|
|
||||||
.nav-menu a{
|
|
||||||
display:inline-block;
|
|
||||||
height:initial;
|
|
||||||
text-align:left;
|
|
||||||
}
|
|
||||||
.mobile{
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.video{
|
|
||||||
overflow:hidden;
|
|
||||||
padding-bottom:56.25%;
|
|
||||||
position:relative;
|
|
||||||
height:0;
|
|
||||||
margin: 1.5rem 0;
|
|
||||||
border-radius: 1rem;
|
|
||||||
background-color: var(--bg);
|
|
||||||
box-shadow: 0 1rem 4rem rgba($dark,0.17);
|
|
||||||
iframe{
|
|
||||||
left:0;
|
|
||||||
top:0;
|
|
||||||
height:100%;
|
|
||||||
width:100%;
|
|
||||||
position:absolute;
|
|
||||||
transform: scale(1.03);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.copy {
|
|
||||||
position: relative;
|
|
||||||
width: 1.5rem;
|
|
||||||
height: 1.5rem;
|
|
||||||
background-image: url(#{$copy-icon-path});
|
|
||||||
background-size: 100%;
|
|
||||||
cursor: pointer;
|
|
||||||
&::before, &::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
background: $theme;
|
|
||||||
color: $light;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.25s ease-in;
|
|
||||||
}
|
|
||||||
&::before {
|
|
||||||
content: "Share Story";
|
|
||||||
font-size: 0.8rem;
|
|
||||||
width: 5.4rem;
|
|
||||||
padding: 0.25rem;
|
|
||||||
border-radius: 0.25rem;
|
|
||||||
text-align: center;
|
|
||||||
top: -2rem;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
&_done::before {
|
|
||||||
content: "Link Copied";
|
|
||||||
}
|
|
||||||
&:hover::before,
|
|
||||||
&:hover::after {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.author,
|
|
||||||
.comment {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 4rem 1fr;
|
|
||||||
grid-gap: 0 1rem ;
|
|
||||||
padding: 1rem;
|
|
||||||
margin: 1.5rem 0;
|
|
||||||
background-color: var(--accent);
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
box-shadow: 0 0.5rem 2rem rgba($dark, 0.12);
|
|
||||||
&_name {
|
|
||||||
color: var(--text) !important;
|
|
||||||
font-size: 1.25rem;
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
&_pic {
|
|
||||||
border-radius: 50%;
|
|
||||||
padding: 0.25rem;
|
|
||||||
margin: 0 0 0 -0.25rem;
|
|
||||||
border-color: $theme transparent;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 1px;
|
|
||||||
}
|
|
||||||
&_bio {
|
|
||||||
padding-bottom: 0 !important;
|
|
||||||
line-height: 1.33;
|
|
||||||
}
|
|
||||||
&_heading {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
}
|
|
||||||
&_meta {
|
|
||||||
display: flex;
|
|
||||||
flex-flow: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
@font-face {
|
|
||||||
font-family: 'Metropolis';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Metropolis Regular'), local('Metropolis-Regular'),
|
|
||||||
url('#{$font-path}/Metropolis-Regular.woff2') format('woff2'), // Super Modern Browsers
|
|
||||||
url('#{$font-path}/Metropolis-Regular.woff') format('woff'), // Modern Browsers
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Metropolis';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 300;
|
|
||||||
src: local('Metropolis Light'), local('Metropolis-Light'),
|
|
||||||
url('#{$font-path}/Metropolis-Light.woff2') format('woff2'), // Super Modern Browsers
|
|
||||||
url('#{$font-path}/Metropolis-Light.woff') format('woff'), // Modern Browsers
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Metropolis';
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: 300;
|
|
||||||
src: local('Metropolis Light Italic'), local('Metropolis-LightItalic'),
|
|
||||||
url('#{$font-path}/Metropolis-LightItalic.woff2') format('woff2'), // Super Modern Browsers
|
|
||||||
url('#{$font-path}/Metropolis-LightItalic.woff') format('woff'), // Modern Browsers
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Metropolis';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 500;
|
|
||||||
src: local('Metropolis Medium'), local('Metropolis-Medium'),
|
|
||||||
url('#{$font-path}/Metropolis-Medium.woff2') format('woff2'), // Super Modern Browsers
|
|
||||||
url('#{$font-path}/Metropolis-Medium.woff') format('woff'), // Modern Browsers
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Metropolis';
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: 500;
|
|
||||||
src: local('Metropolis Medium Italic'), local('Metropolis-MediumItalic'),
|
|
||||||
url('#{$font-path}/Metropolis-MediumItalic.woff2') format('woff2'), // Super Modern Browsers
|
|
||||||
url('#{$font-path}/Metropolis-MediumItalic.woff') format('woff'), // Modern Browsers
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Cookie';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Cookie-Regular'),
|
|
||||||
url('#{$font-path}/cookie-v10-latin-regular.woff2') format('woff2'), // Super Modern Browsers
|
|
||||||
url('#{$font-path}/cookie-v10-latin-regular.woff') format('woff'), // Modern Browsers
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
.footer{
|
|
||||||
padding:0;
|
|
||||||
color:$light;
|
|
||||||
margin:0;
|
|
||||||
background: $dark;
|
|
||||||
width:100%;
|
|
||||||
font-size: 1.05rem;
|
|
||||||
min-height:75px;
|
|
||||||
a {
|
|
||||||
color: $theme;
|
|
||||||
opacity: 0.8;
|
|
||||||
transition: opacity 0.3s ease-in-out;
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_inner{
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 1.5rem;
|
|
||||||
@media screen and (max-width: 567px) {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
@mixin viewport($width: 1024px, $margin: 25px) {
|
|
||||||
max-width: $width;
|
|
||||||
margin: $margin auto;
|
|
||||||
@content;
|
|
||||||
}
|
|
||||||
@mixin shadow($opacity: 0.17) {
|
|
||||||
box-shadow: 0 0 3rem rgba(0,0,0,$opacity);
|
|
||||||
&:hover {
|
|
||||||
box-shadow: 0 0 5rem rgba(0,0,0, (1.5 * $opacity));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,139 +0,0 @@
|
|||||||
.nav{
|
|
||||||
position:absolute;
|
|
||||||
top:0;
|
|
||||||
width:100%;
|
|
||||||
transition:height 0.4s ease-in-out;
|
|
||||||
z-index:999;
|
|
||||||
&_bar {
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
&-wrap {
|
|
||||||
width: 1.8rem;
|
|
||||||
height: 1.8rem;
|
|
||||||
display: grid;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 99;
|
|
||||||
min-height: 1.5rem;
|
|
||||||
}
|
|
||||||
&,
|
|
||||||
&::after,
|
|
||||||
&::before {
|
|
||||||
padding: 1px;
|
|
||||||
border-radius: 2px;
|
|
||||||
background-color: var(--text);
|
|
||||||
}
|
|
||||||
&::after,
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
width: 1.2rem;
|
|
||||||
}
|
|
||||||
&::before {
|
|
||||||
top: -0.5rem;
|
|
||||||
}
|
|
||||||
&::after {
|
|
||||||
top: 0.5rem;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-body{
|
|
||||||
@include shadow;
|
|
||||||
position:fixed;
|
|
||||||
right:10px;
|
|
||||||
z-index:1;
|
|
||||||
top:100%;
|
|
||||||
opacity:0;
|
|
||||||
overflow:hidden;
|
|
||||||
transition:top 0.33s linear;
|
|
||||||
background:transparent;
|
|
||||||
background-color: var(--accent);
|
|
||||||
width:33.3%;
|
|
||||||
width: 16rem;
|
|
||||||
padding: 100px 0;
|
|
||||||
min-height: 67vh;
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
z-index:1;
|
|
||||||
border-radius: 0.33rem;
|
|
||||||
a{
|
|
||||||
display:block;
|
|
||||||
padding:12.5px 25px;
|
|
||||||
margin-bottom:2px;
|
|
||||||
border-bottom:1px solid rgba($dark, 0.04);
|
|
||||||
transition:color 0.25s ease-in-out;
|
|
||||||
&:hover{
|
|
||||||
color: $theme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-brand{
|
|
||||||
font-family: 'Cookie';
|
|
||||||
font-size:2em !important;
|
|
||||||
// max-width:250px;
|
|
||||||
padding-top:0 !important;
|
|
||||||
padding-bottom:0 !important;
|
|
||||||
}
|
|
||||||
&-close {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right:0;
|
|
||||||
width: 100%;
|
|
||||||
cursor:pointer;
|
|
||||||
padding:25px;
|
|
||||||
&:after,
|
|
||||||
&:before{
|
|
||||||
content: '';
|
|
||||||
width: 18px;
|
|
||||||
border-radius:50%;
|
|
||||||
padding: 1.5px;
|
|
||||||
background: var(--text);
|
|
||||||
opacity: 0.7;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
&:before {
|
|
||||||
transform: rotate(20deg) translateX(1.5px);
|
|
||||||
}
|
|
||||||
&:after {
|
|
||||||
transform: rotate(-20deg) translateX(-1.5px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-drop {
|
|
||||||
background: rgba(0,0,0,0.15);
|
|
||||||
top:0;
|
|
||||||
bottom:0;
|
|
||||||
z-index:1000;
|
|
||||||
}
|
|
||||||
&-exit{
|
|
||||||
animation: hideMenu 0.5s ease-out forwards;
|
|
||||||
}
|
|
||||||
&-menu {
|
|
||||||
position: relative;
|
|
||||||
padding:10px 25px 10px 0;
|
|
||||||
height:100%;
|
|
||||||
max-width: 1024px;
|
|
||||||
margin:0 auto;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
a {
|
|
||||||
color:inherit;
|
|
||||||
width:100%;
|
|
||||||
display:block;
|
|
||||||
padding:10px 25px;
|
|
||||||
font-size:105%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&-pop{
|
|
||||||
position: fixed;
|
|
||||||
width:100vw;
|
|
||||||
}
|
|
||||||
&-open {
|
|
||||||
animation: showMenu 0.5s ease-out forwards;
|
|
||||||
}
|
|
||||||
&_item {
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,288 +0,0 @@
|
|||||||
.post{
|
|
||||||
margin:0 auto;
|
|
||||||
padding: 1rem 1.5rem;
|
|
||||||
width:100%;
|
|
||||||
max-width:750px;
|
|
||||||
margin-top: 1.5rem;
|
|
||||||
h1,h2,h3{
|
|
||||||
margin:15px auto;
|
|
||||||
text-align:left;
|
|
||||||
padding:5px 0 0 0;
|
|
||||||
}
|
|
||||||
p{
|
|
||||||
padding-bottom: 0.5rem;
|
|
||||||
padding-top: 0.5rem;
|
|
||||||
font-size: 1.05rem;
|
|
||||||
}
|
|
||||||
&s{
|
|
||||||
display:flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex-flow:row wrap;
|
|
||||||
width: 100%;
|
|
||||||
align-items: stretch;
|
|
||||||
}
|
|
||||||
&s:not(.aside) {
|
|
||||||
padding: 0 30px;
|
|
||||||
}
|
|
||||||
&_content{
|
|
||||||
h4{
|
|
||||||
margin:5px 0;
|
|
||||||
text-align:left;
|
|
||||||
}
|
|
||||||
p{
|
|
||||||
line-height:1.65;
|
|
||||||
&:first-child{
|
|
||||||
margin-top:0;
|
|
||||||
padding-top:0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
a{
|
|
||||||
color: $theme;
|
|
||||||
padding-bottom:7.5px;
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ol, ul {
|
|
||||||
padding: 0.5rem 0 0.5rem 1.2rem;
|
|
||||||
}
|
|
||||||
li {
|
|
||||||
padding: 0.33rem 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_header{
|
|
||||||
background-size:cover;
|
|
||||||
background-repeat:no-repeat;
|
|
||||||
background-position: center;
|
|
||||||
position:relative;
|
|
||||||
color:#fff;
|
|
||||||
height:48vh;
|
|
||||||
min-height: 360px;
|
|
||||||
background-color:$dark;
|
|
||||||
margin-top:60px;
|
|
||||||
padding: 30px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
&::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top:0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom:0;
|
|
||||||
z-index: 1;
|
|
||||||
background: rgba(10, 15, 30, 0.72)
|
|
||||||
}
|
|
||||||
h1 {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
h1, p, h4 {
|
|
||||||
position: relative;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_copy {
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.3s ease-out;
|
|
||||||
}
|
|
||||||
&_item{
|
|
||||||
@include shadow;
|
|
||||||
margin: 1.25rem 0;
|
|
||||||
border-radius: 10px;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 100%;
|
|
||||||
@media screen and (min-width:667px) {
|
|
||||||
width: 47%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_item:hover &_copy{
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
&_link{
|
|
||||||
padding:2.5px 0;
|
|
||||||
font-size:1.25em;
|
|
||||||
margin:2.5px 0;
|
|
||||||
text-align:left;
|
|
||||||
}
|
|
||||||
&_meta {
|
|
||||||
overflow: hidden;
|
|
||||||
opacity: 0.8;
|
|
||||||
font-size: 0.84rem;
|
|
||||||
font-weight: 500;
|
|
||||||
display: inline-grid;
|
|
||||||
grid-template-columns: auto 1fr;
|
|
||||||
background-color: $light;
|
|
||||||
padding: 0;
|
|
||||||
align-items: center;
|
|
||||||
border-radius: 0.3rem;
|
|
||||||
color: $dark;
|
|
||||||
text-transform: capitalize;
|
|
||||||
a {
|
|
||||||
&:hover {
|
|
||||||
color: $theme;
|
|
||||||
text-decoration: underline;
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_extra {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
&_tag {
|
|
||||||
font-size: 0.75rem !important;
|
|
||||||
font-weight: 500;
|
|
||||||
background: $theme;
|
|
||||||
color: $light;
|
|
||||||
padding: 0.25rem 0.67rem !important;
|
|
||||||
text-transform: uppercase;
|
|
||||||
display: inline-flex;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
&_title{
|
|
||||||
margin:5px 0;;
|
|
||||||
}
|
|
||||||
&_author {
|
|
||||||
padding: 0.2rem 0.75rem;
|
|
||||||
a {
|
|
||||||
color: $theme;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_time {
|
|
||||||
background: $theme;
|
|
||||||
display: inline-grid;
|
|
||||||
padding: 0.2rem 0.75rem;
|
|
||||||
color: $light;
|
|
||||||
}
|
|
||||||
&_card {
|
|
||||||
display: block;
|
|
||||||
position:relative;
|
|
||||||
background-color:$dark;
|
|
||||||
border-radius: 0.5rem 0.5rem 0 0;
|
|
||||||
background-size:cover;
|
|
||||||
background-position:center;
|
|
||||||
overflow: hidden;
|
|
||||||
height:10rem;
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
top: 0;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
&:hover::after {
|
|
||||||
background-color:rgba($dark,0.3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_thumbnail {
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pager {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-content: center;
|
|
||||||
margin: 30px auto 0 auto;
|
|
||||||
&, &_item {
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
&_item {
|
|
||||||
height: 36px;
|
|
||||||
width: 36px;
|
|
||||||
display: inline-flex;
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-right: 5px;
|
|
||||||
background: $theme;
|
|
||||||
color: $light;
|
|
||||||
border-radius: 50%;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
&:hover {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&_prev, &_next {
|
|
||||||
background: transparent;
|
|
||||||
background-size: 100%;
|
|
||||||
background-position: center;
|
|
||||||
}
|
|
||||||
&_prev {
|
|
||||||
background-image: url(#{$prev-icon-path});
|
|
||||||
}
|
|
||||||
&_next {
|
|
||||||
background-image: url(#{$next-icon-path});
|
|
||||||
}
|
|
||||||
&_active{
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.excerpt{
|
|
||||||
padding: 0 10px 1.5rem 10px;
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
&_meta {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
transform: translateY(-2.5rem);
|
|
||||||
position: relative;
|
|
||||||
z-index: 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.share{
|
|
||||||
@include shadow;
|
|
||||||
background: $light;
|
|
||||||
border-radius: 5px;
|
|
||||||
align-items:center;
|
|
||||||
justify-content:right;
|
|
||||||
position: fixed;
|
|
||||||
top: 64px;
|
|
||||||
height: 0;
|
|
||||||
opacity: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
a{
|
|
||||||
margin:12.5px 0;
|
|
||||||
opacity:1;
|
|
||||||
transition:opacity 0.3s ease-in-out;
|
|
||||||
&:hover{
|
|
||||||
opacity:0.84;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
img{
|
|
||||||
width:1.25rem;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
&,&_card{
|
|
||||||
display: flex;
|
|
||||||
flex-flow: column;
|
|
||||||
}
|
|
||||||
&_card{
|
|
||||||
width:100%;
|
|
||||||
padding:25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-close{
|
|
||||||
animation: hideShare 0.3s ease-out;
|
|
||||||
}
|
|
||||||
&-open{
|
|
||||||
animation: showShare 0.3s ease-out;
|
|
||||||
width: 210px;
|
|
||||||
padding: 25px 15px;
|
|
||||||
height: auto;
|
|
||||||
opacity: 1;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
&-trigger{
|
|
||||||
width: 24px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
|
|
||||||
.highlight {
|
|
||||||
margin: 1.25rem 0;
|
|
||||||
& & {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
pre{
|
|
||||||
padding: 1rem;
|
|
||||||
margin: 1.5rem 0;
|
|
||||||
background: var(--bubble) !important;
|
|
||||||
box-shadow: 0 0 2.5rem rgba(0,0,0,0.12);
|
|
||||||
// word-break: break-all;
|
|
||||||
// word-wrap: break-word;
|
|
||||||
border-radius: 4px;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
.pale {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
.hidden{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.center{
|
|
||||||
text-align:center;
|
|
||||||
margin:5px auto;
|
|
||||||
}
|
|
||||||
.left{
|
|
||||||
text-align:left;
|
|
||||||
}
|
|
||||||
.wrap{
|
|
||||||
padding:10px 0;
|
|
||||||
max-width: 1024px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
.mt {
|
|
||||||
margin-top: 7rem;
|
|
||||||
}
|
|
||||||
.link {
|
|
||||||
display: inline-block;
|
|
||||||
width: 2.5rem;
|
|
||||||
margin: 0 0.25rem;
|
|
||||||
padding: 0 0.25rem;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.3s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
||||||
&_owner:hover & {
|
|
||||||
opacity: 0.9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.solo {
|
|
||||||
grid-column: 1/-1;
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
$padding: 10px;
|
|
||||||
$margin: 25px;
|
|
||||||
$theme: #04a763;
|
|
||||||
$light: #fff;
|
|
||||||
$dark: #131313;
|
|
||||||
$text: #343434;
|
|
||||||
$linear: linear-gradient(to right bottom, darken($theme, 10%), $theme);
|
|
||||||
:root {
|
|
||||||
--light: #fff;
|
|
||||||
--dark: #131313;
|
|
||||||
--gray: #f5f5f5;
|
|
||||||
--bubble: #181818;
|
|
||||||
--accent: var(--gray);
|
|
||||||
--bg: var(--light);
|
|
||||||
--text: var(--dark);
|
|
||||||
--font: 'Metropolis', sans-serif;
|
|
||||||
}
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
:root {
|
|
||||||
--bg: var(--dark);
|
|
||||||
--text: var(--light);
|
|
||||||
--accent: var(--bubble);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
$font-path: '{{ "fonts" | absURL }}';
|
|
||||||
$copy-icon-path: '{{ "images/icons/copy.svg" | absURL }}';
|
|
||||||
$prev-icon-path: '{{ "images/icons/previous.svg" | absURL }}';
|
|
||||||
$next-icon-path: '{{ "images/icons/next.svg" | absURL }}';
|
|
||||||
|
|
||||||
@import
|
|
||||||
'fonts',
|
|
||||||
'variables',
|
|
||||||
'mixins',
|
|
||||||
'animate',
|
|
||||||
'base',
|
|
||||||
'components',
|
|
||||||
'utils',
|
|
||||||
'nav',
|
|
||||||
'posts',
|
|
||||||
'audio',
|
|
||||||
'footer',
|
|
||||||
'comments',
|
|
||||||
'syntax';
|
|
@ -1,14 +0,0 @@
|
|||||||
image: monachus/hugo
|
|
||||||
|
|
||||||
variables:
|
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
|
||||||
|
|
||||||
pages:
|
|
||||||
script:
|
|
||||||
- cd exampleSite
|
|
||||||
- hugo --themesDir=../.. -d ../public
|
|
||||||
artifacts:
|
|
||||||
paths:
|
|
||||||
- public
|
|
||||||
only:
|
|
||||||
- master
|
|
@ -1,29 +0,0 @@
|
|||||||
baseurl = "https://example.com/" # Include trailing slash
|
|
||||||
title = "Hugo Themes"
|
|
||||||
theme = "hugo-swift-theme"
|
|
||||||
author = "Steve Francia"
|
|
||||||
copyright = "Copyright © 2008–2018, Steve Francia and the Hugo Authors; all rights reserved."
|
|
||||||
canonifyurls = true
|
|
||||||
paginate = 4
|
|
||||||
# Enable syntax highlighting
|
|
||||||
# comment on delete the following lines 11 ~ 13
|
|
||||||
pygmentsCodefences = true
|
|
||||||
pygmentsCodefencesGuessSyntax = true
|
|
||||||
|
|
||||||
[params]
|
|
||||||
# ga_analytics = "" # google analytics ID e.g UA-116386578-1
|
|
||||||
|
|
||||||
# ga_verify = "" # google verification code e.g 5jb-rxeBfITeJQKOuUss3ud6FPGTxXkCho-ZN5qlrZg
|
|
||||||
# twitter = "" # twitter handle e.g @weru
|
|
||||||
|
|
||||||
# [params.staticman]
|
|
||||||
# endpoint = "https://api.staticman.net" # URL of your own API deployment (without trailing slash), default: "https://api.staticman.net"
|
|
||||||
# gitProvider = "github" # Either "github" or "gitlab"
|
|
||||||
# username = "username" # GitHub/GitLab user name
|
|
||||||
# repository = "repo" # GitHub/GitLab user name
|
|
||||||
# branch = "master" # Branch holding the source code for your site, should match the `branch` parameter in `staticman.yml`
|
|
||||||
#
|
|
||||||
# # If you use reCAPTCHA v2, you must also set these parameters in staticman.yml
|
|
||||||
# [Params.staticman.reCaptcha]
|
|
||||||
# siteKey = "" # Use your own site key, you need to apply for one on Google
|
|
||||||
# secret = "" # ENCRYPT your password by going to https://<staticman-endpoint>/v3/encrypt/<your-site-secret>
|
|
@ -1,18 +0,0 @@
|
|||||||
+++
|
|
||||||
title = "About Hugo"
|
|
||||||
date = "2014-04-09"
|
|
||||||
image = 'read.jpg'
|
|
||||||
+++
|
|
||||||
|
|
||||||
Hugo is the **world’s fastest framework for building websites**. It is written in Go.
|
|
||||||
|
|
||||||
It makes use of a variety of open source projects including:
|
|
||||||
|
|
||||||
* https://github.com/russross/blackfriday
|
|
||||||
* https://github.com/alecthomas/chroma
|
|
||||||
* https://github.com/muesli/smartcrop
|
|
||||||
* https://github.com/spf13/cobra
|
|
||||||
* https://github.com/spf13/viper
|
|
||||||
|
|
||||||
Learn more and contribute on [GitHub](https://github.com/gohugoio).
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,344 +0,0 @@
|
|||||||
+++
|
|
||||||
title = "(Hu)go Template Primer"
|
|
||||||
description = ""
|
|
||||||
tags = [
|
|
||||||
"go",
|
|
||||||
"golang",
|
|
||||||
"templates",
|
|
||||||
"themes",
|
|
||||||
"development",
|
|
||||||
]
|
|
||||||
date = "2014-04-02"
|
|
||||||
categories = [
|
|
||||||
"Development",
|
|
||||||
"golang",
|
|
||||||
]
|
|
||||||
image = "fast-lane.jpg"
|
|
||||||
+++
|
|
||||||
|
|
||||||
Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for
|
|
||||||
its template engine. It is an extremely lightweight engine that provides a very
|
|
||||||
small amount of logic. In our experience that it is just the right amount of
|
|
||||||
logic to be able to create a good static website. If you have used other
|
|
||||||
template systems from different languages or frameworks you will find a lot of
|
|
||||||
similarities in Go templates.
|
|
||||||
|
|
||||||
This document is a brief primer on using Go templates. The [Go docs][gohtmltemplate]
|
|
||||||
provide more details.
|
|
||||||
|
|
||||||
## Introduction to Go Templates
|
|
||||||
|
|
||||||
Go templates provide an extremely simple template language. It adheres to the
|
|
||||||
belief that only the most basic of logic belongs in the template or view layer.
|
|
||||||
One consequence of this simplicity is that Go templates parse very quickly.
|
|
||||||
|
|
||||||
A unique characteristic of Go templates is they are content aware. Variables and
|
|
||||||
content will be sanitized depending on the context of where they are used. More
|
|
||||||
details can be found in the [Go docs][gohtmltemplate].
|
|
||||||
|
|
||||||
## Basic Syntax
|
|
||||||
|
|
||||||
Golang templates are HTML files with the addition of variables and
|
|
||||||
functions.
|
|
||||||
|
|
||||||
**Go variables and functions are accessible within {{ }}**
|
|
||||||
|
|
||||||
Accessing a predefined variable "foo":
|
|
||||||
|
|
||||||
{{ foo }}
|
|
||||||
|
|
||||||
**Parameters are separated using spaces**
|
|
||||||
|
|
||||||
Calling the add function with input of 1, 2:
|
|
||||||
|
|
||||||
{{ add 1 2 }}
|
|
||||||
|
|
||||||
**Methods and fields are accessed via dot notation**
|
|
||||||
|
|
||||||
Accessing the Page Parameter "bar"
|
|
||||||
|
|
||||||
{{ .Params.bar }}
|
|
||||||
|
|
||||||
**Parentheses can be used to group items together**
|
|
||||||
|
|
||||||
{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
|
|
||||||
|
|
||||||
|
|
||||||
## Variables
|
|
||||||
|
|
||||||
Each Go template has a struct (object) made available to it. In hugo each
|
|
||||||
template is passed either a page or a node struct depending on which type of
|
|
||||||
page you are rendering. More details are available on the
|
|
||||||
[variables](/layout/variables) page.
|
|
||||||
|
|
||||||
A variable is accessed by referencing the variable name.
|
|
||||||
|
|
||||||
<title>{{ .Title }}</title>
|
|
||||||
|
|
||||||
Variables can also be defined and referenced.
|
|
||||||
|
|
||||||
{{ $address := "123 Main St."}}
|
|
||||||
{{ $address }}
|
|
||||||
|
|
||||||
|
|
||||||
## Functions
|
|
||||||
|
|
||||||
Go template ship with a few functions which provide basic functionality. The Go
|
|
||||||
template system also provides a mechanism for applications to extend the
|
|
||||||
available functions with their own. [Hugo template
|
|
||||||
functions](/layout/functions) provide some additional functionality we believe
|
|
||||||
are useful for building websites. Functions are called by using their name
|
|
||||||
followed by the required parameters separated by spaces. Template
|
|
||||||
functions cannot be added without recompiling hugo.
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
{{ add 1 2 }}
|
|
||||||
|
|
||||||
## Includes
|
|
||||||
|
|
||||||
When including another template you will pass to it the data it will be
|
|
||||||
able to access. To pass along the current context please remember to
|
|
||||||
include a trailing dot. The templates location will always be starting at
|
|
||||||
the /layout/ directory within Hugo.
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
{{ template "chrome/header.html" . }}
|
|
||||||
|
|
||||||
|
|
||||||
## Logic
|
|
||||||
|
|
||||||
Go templates provide the most basic iteration and conditional logic.
|
|
||||||
|
|
||||||
### Iteration
|
|
||||||
|
|
||||||
Just like in Go, the Go templates make heavy use of range to iterate over
|
|
||||||
a map, array or slice. The following are different examples of how to use
|
|
||||||
range.
|
|
||||||
|
|
||||||
**Example 1: Using Context**
|
|
||||||
|
|
||||||
{{ range array }}
|
|
||||||
{{ . }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
**Example 2: Declaring value variable name**
|
|
||||||
|
|
||||||
{{range $element := array}}
|
|
||||||
{{ $element }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
**Example 2: Declaring key and value variable name**
|
|
||||||
|
|
||||||
{{range $index, $element := array}}
|
|
||||||
{{ $index }}
|
|
||||||
{{ $element }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
### Conditionals
|
|
||||||
|
|
||||||
If, else, with, or, & and provide the framework for handling conditional
|
|
||||||
logic in Go Templates. Like range, each statement is closed with `end`.
|
|
||||||
|
|
||||||
|
|
||||||
Go Templates treat the following values as false:
|
|
||||||
|
|
||||||
* false
|
|
||||||
* 0
|
|
||||||
* any array, slice, map, or string of length zero
|
|
||||||
|
|
||||||
**Example 1: If**
|
|
||||||
|
|
||||||
{{ if isset .Params "title" }}<h4>{{ index .Params "title" }}</h4>{{ end }}
|
|
||||||
|
|
||||||
**Example 2: If -> Else**
|
|
||||||
|
|
||||||
{{ if isset .Params "alt" }}
|
|
||||||
{{ index .Params "alt" }}
|
|
||||||
{{else}}
|
|
||||||
{{ index .Params "caption" }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
**Example 3: And & Or**
|
|
||||||
|
|
||||||
{{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
|
|
||||||
|
|
||||||
**Example 4: With**
|
|
||||||
|
|
||||||
An alternative way of writing "if" and then referencing the same value
|
|
||||||
is to use "with" instead. With rebinds the context `.` within its scope,
|
|
||||||
and skips the block if the variable is absent.
|
|
||||||
|
|
||||||
The first example above could be simplified as:
|
|
||||||
|
|
||||||
{{ with .Params.title }}<h4>{{ . }}</h4>{{ end }}
|
|
||||||
|
|
||||||
**Example 5: If -> Else If**
|
|
||||||
|
|
||||||
{{ if isset .Params "alt" }}
|
|
||||||
{{ index .Params "alt" }}
|
|
||||||
{{ else if isset .Params "caption" }}
|
|
||||||
{{ index .Params "caption" }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
## Pipes
|
|
||||||
|
|
||||||
One of the most powerful components of Go templates is the ability to
|
|
||||||
stack actions one after another. This is done by using pipes. Borrowed
|
|
||||||
from unix pipes, the concept is simple, each pipeline's output becomes the
|
|
||||||
input of the following pipe.
|
|
||||||
|
|
||||||
Because of the very simple syntax of Go templates, the pipe is essential
|
|
||||||
to being able to chain together function calls. One limitation of the
|
|
||||||
pipes is that they only can work with a single value and that value
|
|
||||||
becomes the last parameter of the next pipeline.
|
|
||||||
|
|
||||||
A few simple examples should help convey how to use the pipe.
|
|
||||||
|
|
||||||
**Example 1 :**
|
|
||||||
|
|
||||||
{{ if eq 1 1 }} Same {{ end }}
|
|
||||||
|
|
||||||
is the same as
|
|
||||||
|
|
||||||
{{ eq 1 1 | if }} Same {{ end }}
|
|
||||||
|
|
||||||
It does look odd to place the if at the end, but it does provide a good
|
|
||||||
illustration of how to use the pipes.
|
|
||||||
|
|
||||||
**Example 2 :**
|
|
||||||
|
|
||||||
{{ index .Params "disqus_url" | html }}
|
|
||||||
|
|
||||||
Access the page parameter called "disqus_url" and escape the HTML.
|
|
||||||
|
|
||||||
**Example 3 :**
|
|
||||||
|
|
||||||
{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
|
|
||||||
Stuff Here
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
Could be rewritten as
|
|
||||||
|
|
||||||
{{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }}
|
|
||||||
Stuff Here
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
|
|
||||||
## Context (aka. the dot)
|
|
||||||
|
|
||||||
The most easily overlooked concept to understand about Go templates is that {{ . }}
|
|
||||||
always refers to the current context. In the top level of your template this
|
|
||||||
will be the data set made available to it. Inside of a iteration it will have
|
|
||||||
the value of the current item. When inside of a loop the context has changed. .
|
|
||||||
will no longer refer to the data available to the entire page. If you need to
|
|
||||||
access this from within the loop you will likely want to set it to a variable
|
|
||||||
instead of depending on the context.
|
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
{{ $title := .Site.Title }}
|
|
||||||
{{ range .Params.tags }}
|
|
||||||
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
Notice how once we have entered the loop the value of {{ . }} has changed. We
|
|
||||||
have defined a variable outside of the loop so we have access to it from within
|
|
||||||
the loop.
|
|
||||||
|
|
||||||
# Hugo Parameters
|
|
||||||
|
|
||||||
Hugo provides the option of passing values to the template language
|
|
||||||
through the site configuration (for sitewide values), or through the meta
|
|
||||||
data of each specific piece of content. You can define any values of any
|
|
||||||
type (supported by your front matter/config format) and use them however
|
|
||||||
you want to inside of your templates.
|
|
||||||
|
|
||||||
|
|
||||||
## Using Content (page) Parameters
|
|
||||||
|
|
||||||
In each piece of content you can provide variables to be used by the
|
|
||||||
templates. This happens in the [front matter](/content/front-matter).
|
|
||||||
|
|
||||||
An example of this is used in this documentation site. Most of the pages
|
|
||||||
benefit from having the table of contents provided. Sometimes the TOC just
|
|
||||||
doesn't make a lot of sense. We've defined a variable in our front matter
|
|
||||||
of some pages to turn off the TOC from being displayed.
|
|
||||||
|
|
||||||
Here is the example front matter:
|
|
||||||
|
|
||||||
```
|
|
||||||
---
|
|
||||||
title: "Permalinks"
|
|
||||||
date: "2013-11-18"
|
|
||||||
aliases:
|
|
||||||
- "/doc/permalinks/"
|
|
||||||
groups: ["extras"]
|
|
||||||
groups_weight: 30
|
|
||||||
notoc: true
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
Here is the corresponding code inside of the template:
|
|
||||||
|
|
||||||
{{ if not .Params.notoc }}
|
|
||||||
<div id="toc" class="well col-md-4 col-sm-6">
|
|
||||||
{{ .TableOfContents }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Using Site (config) Parameters
|
|
||||||
In your top-level configuration file (eg, `config.yaml`) you can define site
|
|
||||||
parameters, which are values which will be available to you in chrome.
|
|
||||||
|
|
||||||
For instance, you might declare:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
params:
|
|
||||||
CopyrightHTML: "Copyright © 2013 John Doe. All Rights Reserved."
|
|
||||||
TwitterUser: "spf13"
|
|
||||||
SidebarRecentLimit: 5
|
|
||||||
```
|
|
||||||
|
|
||||||
Within a footer layout, you might then declare a `<footer>` which is only
|
|
||||||
provided if the `CopyrightHTML` parameter is provided, and if it is given,
|
|
||||||
you would declare it to be HTML-safe, so that the HTML entity is not escaped
|
|
||||||
again. This would let you easily update just your top-level config file each
|
|
||||||
January 1st, instead of hunting through your templates.
|
|
||||||
|
|
||||||
```
|
|
||||||
{{if .Site.Params.CopyrightHTML}}<footer>
|
|
||||||
<div class="text-center">{{.Site.Params.CopyrightHTML | safeHtml}}</div>
|
|
||||||
</footer>{{end}}
|
|
||||||
```
|
|
||||||
|
|
||||||
An alternative way of writing the "if" and then referencing the same value
|
|
||||||
is to use "with" instead. With rebinds the context `.` within its scope,
|
|
||||||
and skips the block if the variable is absent:
|
|
||||||
|
|
||||||
```
|
|
||||||
{{with .Site.Params.TwitterUser}}<span class="twitter">
|
|
||||||
<a href="https://twitter.com/{{.}}" rel="author">
|
|
||||||
<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
|
|
||||||
alt="Twitter"></a>
|
|
||||||
</span>{{end}}
|
|
||||||
```
|
|
||||||
|
|
||||||
Finally, if you want to pull "magic constants" out of your layouts, you can do
|
|
||||||
so, such as in this example:
|
|
||||||
|
|
||||||
```
|
|
||||||
<nav class="recent">
|
|
||||||
<h1>Recent Posts</h1>
|
|
||||||
<ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
|
|
||||||
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
|
|
||||||
{{end}}</ul>
|
|
||||||
</nav>
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
[go]: https://golang.org/
|
|
||||||
[gohtmltemplate]: https://golang.org/pkg/html/template/
|
|
@ -1,89 +0,0 @@
|
|||||||
+++
|
|
||||||
title = "Getting Started with Hugo"
|
|
||||||
description = ""
|
|
||||||
tags = [
|
|
||||||
"go",
|
|
||||||
"golang",
|
|
||||||
"hugo",
|
|
||||||
"development",
|
|
||||||
]
|
|
||||||
date = "2014-04-02"
|
|
||||||
categories = [
|
|
||||||
"Development",
|
|
||||||
"golang",
|
|
||||||
]
|
|
||||||
image = "stuck.jpg"
|
|
||||||
+++
|
|
||||||
|
|
||||||
## Step 1. Install Hugo
|
|
||||||
|
|
||||||
Go to [Hugo releases](https://github.com/spf13/hugo/releases) and download the
|
|
||||||
appropriate version for your OS and architecture.
|
|
||||||
|
|
||||||
Save it somewhere specific as we will be using it in the next step.
|
|
||||||
|
|
||||||
More complete instructions are available at [Install Hugo](https://gohugo.io/getting-started/installing/)
|
|
||||||
|
|
||||||
## Step 2. Build the Docs
|
|
||||||
|
|
||||||
Hugo has its own example site which happens to also be the documentation site
|
|
||||||
you are reading right now.
|
|
||||||
|
|
||||||
Follow the following steps:
|
|
||||||
|
|
||||||
1. Clone the [Hugo repository](http://github.com/spf13/hugo)
|
|
||||||
2. Go into the repo
|
|
||||||
3. Run hugo in server mode and build the docs
|
|
||||||
4. Open your browser to http://localhost:1313
|
|
||||||
|
|
||||||
Corresponding pseudo commands:
|
|
||||||
|
|
||||||
git clone https://github.com/spf13/hugo
|
|
||||||
cd hugo
|
|
||||||
/path/to/where/you/installed/hugo server --source=./docs
|
|
||||||
> 29 pages created
|
|
||||||
> 0 tags index created
|
|
||||||
> in 27 ms
|
|
||||||
> Web Server is available at http://localhost:1313
|
|
||||||
> Press ctrl+c to stop
|
|
||||||
|
|
||||||
Once you've gotten here, follow along the rest of this page on your local build.
|
|
||||||
|
|
||||||
## Step 3. Change the docs site
|
|
||||||
|
|
||||||
Stop the Hugo process by hitting Ctrl+C.
|
|
||||||
|
|
||||||
Now we are going to run hugo again, but this time with hugo in watch mode.
|
|
||||||
|
|
||||||
/path/to/hugo/from/step/1/hugo server --source=./docs --watch
|
|
||||||
> 29 pages created
|
|
||||||
> 0 tags index created
|
|
||||||
> in 27 ms
|
|
||||||
> Web Server is available at http://localhost:1313
|
|
||||||
> Watching for changes in /Users/spf13/Code/hugo/docs/content
|
|
||||||
> Press ctrl+c to stop
|
|
||||||
|
|
||||||
|
|
||||||
Open your [favorite editor](http://vim.spf13.com) and change one of the source
|
|
||||||
content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.
|
|
||||||
|
|
||||||
Content files are found in `docs/content/`. Unless otherwise specified, files
|
|
||||||
are located at the same relative location as the url, in our case
|
|
||||||
`docs/content/overview/quickstart.md`.
|
|
||||||
|
|
||||||
Change and save this file.. Notice what happened in your terminal.
|
|
||||||
|
|
||||||
> Change detected, rebuilding site
|
|
||||||
|
|
||||||
> 29 pages created
|
|
||||||
> 0 tags index created
|
|
||||||
> in 26 ms
|
|
||||||
|
|
||||||
Refresh the browser and observe that the typo is now fixed.
|
|
||||||
|
|
||||||
Notice how quick that was. Try to refresh the site before it's finished building. I double dare you.
|
|
||||||
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.
|
|
||||||
|
|
||||||
## Step 4. Have fun
|
|
||||||
|
|
||||||
The best way to learn something is to play with it.
|
|
@ -1,151 +0,0 @@
|
|||||||
---
|
|
||||||
date: 2014-03-10
|
|
||||||
title: Migrate to Hugo from Jekyll
|
|
||||||
image: 'speakers.jpg'
|
|
||||||
---
|
|
||||||
|
|
||||||
## Move static content to `static`
|
|
||||||
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there.
|
|
||||||
With Jekyll, something that looked like
|
|
||||||
|
|
||||||
▾ <root>/
|
|
||||||
▾ images/
|
|
||||||
logo.png
|
|
||||||
|
|
||||||
should become
|
|
||||||
|
|
||||||
▾ <root>/
|
|
||||||
▾ static/
|
|
||||||
▾ images/
|
|
||||||
logo.png
|
|
||||||
|
|
||||||
Additionally, you'll want any files that should reside at the root (such as `CNAME`) to be moved to `static`.
|
|
||||||
|
|
||||||
## Create your Hugo configuration file
|
|
||||||
Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the [Hugo configuration documentation](/overview/configuration/) for details.
|
|
||||||
|
|
||||||
## Set your configuration publish folder to `_site`
|
|
||||||
The default is for Jekyll to publish to `_site` and for Hugo to publish to `public`. If, like me, you have [`_site` mapped to a git submodule on the `gh-pages` branch](http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html), you'll want to do one of two alternatives:
|
|
||||||
|
|
||||||
1. Change your submodule to point to map `gh-pages` to public instead of `_site` (recommended).
|
|
||||||
|
|
||||||
git submodule deinit _site
|
|
||||||
git rm _site
|
|
||||||
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
|
|
||||||
|
|
||||||
2. Or, change the Hugo configuration to use `_site` instead of `public`.
|
|
||||||
|
|
||||||
{
|
|
||||||
..
|
|
||||||
"publishdir": "_site",
|
|
||||||
..
|
|
||||||
}
|
|
||||||
|
|
||||||
## Convert Jekyll templates to Hugo templates
|
|
||||||
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.
|
|
||||||
|
|
||||||
As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours.
|
|
||||||
|
|
||||||
## Convert Jekyll plugins to Hugo shortcodes
|
|
||||||
Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port.
|
|
||||||
|
|
||||||
### Implementation
|
|
||||||
As an example, I was using a custom [`image_tag`](https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb) plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.
|
|
||||||
|
|
||||||
Jekyll's plugin:
|
|
||||||
|
|
||||||
module Jekyll
|
|
||||||
class ImageTag < Liquid::Tag
|
|
||||||
@url = nil
|
|
||||||
@caption = nil
|
|
||||||
@class = nil
|
|
||||||
@link = nil
|
|
||||||
// Patterns
|
|
||||||
IMAGE_URL_WITH_CLASS_AND_CAPTION =
|
|
||||||
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
|
|
||||||
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
|
|
||||||
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
|
|
||||||
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
|
|
||||||
def initialize(tag_name, markup, tokens)
|
|
||||||
super
|
|
||||||
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
|
|
||||||
@class = $1
|
|
||||||
@url = $3
|
|
||||||
@caption = $7
|
|
||||||
@link = $9
|
|
||||||
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
|
|
||||||
@class = $1
|
|
||||||
@url = $3
|
|
||||||
@caption = $7
|
|
||||||
elsif markup =~ IMAGE_URL_WITH_CAPTION
|
|
||||||
@url = $1
|
|
||||||
@caption = $5
|
|
||||||
elsif markup =~ IMAGE_URL_WITH_CLASS
|
|
||||||
@class = $1
|
|
||||||
@url = $3
|
|
||||||
elsif markup =~ IMAGE_URL
|
|
||||||
@url = $1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
def render(context)
|
|
||||||
if @class
|
|
||||||
source = "<figure class='#{@class}'>"
|
|
||||||
else
|
|
||||||
source = "<figure>"
|
|
||||||
end
|
|
||||||
if @link
|
|
||||||
source += "<a href=\"#{@link}\">"
|
|
||||||
end
|
|
||||||
source += "<img src=\"#{@url}\">"
|
|
||||||
if @link
|
|
||||||
source += "</a>"
|
|
||||||
end
|
|
||||||
source += "<figcaption>#{@caption}</figcaption>" if @caption
|
|
||||||
source += "</figure>"
|
|
||||||
source
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Liquid::Template.register_tag('image', Jekyll::ImageTag)
|
|
||||||
|
|
||||||
is written as this Hugo shortcode:
|
|
||||||
|
|
||||||
<!-- image -->
|
|
||||||
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
|
|
||||||
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
|
|
||||||
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
|
|
||||||
{{ if .Get "link"}}</a>{{ end }}
|
|
||||||
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
|
|
||||||
<figcaption>{{ if isset .Params "title" }}
|
|
||||||
{{ .Get "title" }}{{ end }}
|
|
||||||
{{ if or (.Get "caption") (.Get "attr")}}<p>
|
|
||||||
{{ .Get "caption" }}
|
|
||||||
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
|
|
||||||
{{ .Get "attr" }}
|
|
||||||
{{ if .Get "attrlink"}}</a> {{ end }}
|
|
||||||
</p> {{ end }}
|
|
||||||
</figcaption>
|
|
||||||
{{ end }}
|
|
||||||
</figure>
|
|
||||||
<!-- image -->
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
I simply changed:
|
|
||||||
|
|
||||||
{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg "One of my favorite touristy-type photos. I secretly waited for the good light while we were "having fun" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}
|
|
||||||
|
|
||||||
to this (this example uses a slightly extended version named `fig`, different than the built-in `figure`):
|
|
||||||
|
|
||||||
{{%/* fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" */%}}
|
|
||||||
|
|
||||||
As a bonus, the shortcode named parameters are, arguably, more readable.
|
|
||||||
|
|
||||||
## Finishing touches
|
|
||||||
### Fix content
|
|
||||||
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.
|
|
||||||
|
|
||||||
### Clean up
|
|
||||||
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.
|
|
||||||
|
|
||||||
## A practical example in a diff
|
|
||||||
[Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).
|
|
@ -1,4 +0,0 @@
|
|||||||
- name: weru
|
|
||||||
twitter: onweru
|
|
||||||
photo: 'weru.jpg'
|
|
||||||
url: https://www.linkedin.com/in/dan-weru-profile/
|
|
@ -1,2 +0,0 @@
|
|||||||
name: Weru
|
|
||||||
url: https://www.linkedin.com/in/dan-weru-profile/
|
|
@ -1,10 +0,0 @@
|
|||||||
- item: About
|
|
||||||
url: about/
|
|
||||||
- item: Blog
|
|
||||||
url: ""
|
|
||||||
- item: Category A
|
|
||||||
url: categories/development/
|
|
||||||
- item: Category B
|
|
||||||
url: categories/golang/
|
|
||||||
- item: Tag B
|
|
||||||
url: tags/go/
|
|
@ -1,339 +0,0 @@
|
|||||||
function createEl(element) {
|
|
||||||
return document.createElement(element);
|
|
||||||
}
|
|
||||||
|
|
||||||
function elem(selector, parent = document){
|
|
||||||
let elem = document.querySelector(selector);
|
|
||||||
return elem != false ? elem : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function elems(selector) {
|
|
||||||
let elems = document.querySelectorAll(selector);
|
|
||||||
return elems.length ? elems : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function pushClass(el, targetClass) {
|
|
||||||
// equivalent to addClass
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? false : elClass.add(targetClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteClass(el, targetClass) {
|
|
||||||
// equivalent to removeClass
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? elClass.remove(targetClass) : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function modifyClass(el, targetClass) {
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
elClass = el.classList;
|
|
||||||
elClass.contains(targetClass) ? elClass.remove(targetClass) : elClass.add(targetClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function containsClass(el, targetClass) {
|
|
||||||
if (el && typeof el == 'object' && targetClass) {
|
|
||||||
return el.classList.contains(targetClass) ? true : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isChild(node, parentClass) {
|
|
||||||
let objectsAreValid = node && typeof node == 'object' && parentClass && typeof parentClass == 'string';
|
|
||||||
return (objectsAreValid && node.closest(parentClass)) ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
(function updateDate() {
|
|
||||||
var date = new Date();
|
|
||||||
var year = date.getFullYear();
|
|
||||||
elem('.year').innerHTML = year;
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
let bar = 'nav_bar-wrap';
|
|
||||||
let navBar = elem(`.${bar}`);
|
|
||||||
let nav = elem('.nav-body');
|
|
||||||
let open = 'nav-open';
|
|
||||||
let exit = 'nav-exit';
|
|
||||||
let drop = 'nav-drop';
|
|
||||||
let pop = 'nav-pop';
|
|
||||||
let navDrop = elem(`.${drop}`);
|
|
||||||
let hidden = 'hidden';
|
|
||||||
|
|
||||||
function toggleMenu(){
|
|
||||||
modifyClass(navDrop, pop);
|
|
||||||
modifyClass(navBar, hidden);
|
|
||||||
let menuOpen = containsClass(nav, open);
|
|
||||||
let menuPulled = containsClass(nav, exit);
|
|
||||||
|
|
||||||
let status = menuOpen || menuPulled ? true : false;
|
|
||||||
|
|
||||||
status ? modifyClass(nav, exit) : modifyClass(nav, open);
|
|
||||||
status ? modifyClass(nav, open) : modifyClass(nav, exit);
|
|
||||||
}
|
|
||||||
|
|
||||||
// $('.nav-bar, .nav-close').on('click', () => toggleMenu());
|
|
||||||
navBar.addEventListener('click', function() {
|
|
||||||
toggleMenu();
|
|
||||||
});
|
|
||||||
elem('.nav-close').addEventListener('click', function() {
|
|
||||||
toggleMenu();
|
|
||||||
});
|
|
||||||
|
|
||||||
elem('.nav-drop').addEventListener('click', function(e) {
|
|
||||||
e.target === this ? toggleMenu() : false;
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function share(){
|
|
||||||
let share = elem('.share');
|
|
||||||
let open = 'share-open';
|
|
||||||
let close = 'share-close';
|
|
||||||
let button = elem('.share-trigger');
|
|
||||||
|
|
||||||
function showShare() {
|
|
||||||
pushClass(share, open);
|
|
||||||
deleteClass(share, close);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideShare() {
|
|
||||||
pushClass(share, open);
|
|
||||||
deleteClass(share, close);
|
|
||||||
}
|
|
||||||
if (button) {
|
|
||||||
button.addEventListener('click', function() {
|
|
||||||
showShare();
|
|
||||||
setTimeout(hideShare, 5000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function comments(){
|
|
||||||
|
|
||||||
let comments = elem('.js-comments');
|
|
||||||
let form = elem('.form');
|
|
||||||
let body = elem('body');
|
|
||||||
let button = elem('.form_toggle');
|
|
||||||
let loading = 'form-loading';
|
|
||||||
let open = 'form-open';
|
|
||||||
let show = 'modal_show'
|
|
||||||
let toggled = 'toggled';
|
|
||||||
|
|
||||||
let successOutput = [
|
|
||||||
'Review submitted',
|
|
||||||
'Thanks for your review! It will show on the site once it has been approved.'
|
|
||||||
];
|
|
||||||
|
|
||||||
let errorOutput = [
|
|
||||||
'Error',
|
|
||||||
'Sorry, there was an error with the submission!'
|
|
||||||
];
|
|
||||||
|
|
||||||
function handleForm(form) {
|
|
||||||
form.addEventListener('submit', function (event) {
|
|
||||||
pushClass(form, loading);
|
|
||||||
|
|
||||||
function resetForm() {
|
|
||||||
deleteClass(form, loading);
|
|
||||||
// $("form").trigger("reset");
|
|
||||||
}
|
|
||||||
|
|
||||||
function formActions(message) {
|
|
||||||
showModal(...message) // array destructuring
|
|
||||||
resetForm();
|
|
||||||
}
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
function formToJSON(obj) {
|
|
||||||
let rawData = Array.from(obj.elements);
|
|
||||||
let data = {};
|
|
||||||
rawData.forEach(function(element){
|
|
||||||
data[element.name] = element.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
return JSON.stringify(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
let data = formToJSON(form);
|
|
||||||
let url = form.getAttribute('action').trim();
|
|
||||||
fetch(url, {
|
|
||||||
method: "POST",
|
|
||||||
body: data,
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
}).then(function(res) {
|
|
||||||
if(res.ok) {
|
|
||||||
formActions(successOutput);
|
|
||||||
} else {
|
|
||||||
formActions(errorOutput);
|
|
||||||
}
|
|
||||||
}).catch(function(error) {
|
|
||||||
formActions(errorOutput);
|
|
||||||
console.error('Error:', error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
form ? handleForm(form) : false;
|
|
||||||
function closeModal() {
|
|
||||||
elem('.modal_close').addEventListener('click', function () {
|
|
||||||
deleteClass(body, show);
|
|
||||||
deleteClass(form, loading);
|
|
||||||
deleteClass(form, open);
|
|
||||||
deleteClass(button, toggled);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
containsClass(body, show) ? closeModal() : false;
|
|
||||||
|
|
||||||
function showModal(title, message) {
|
|
||||||
elem('.modal_title').textContent = title;
|
|
||||||
elem('.modal_text').innerHTML = message;
|
|
||||||
|
|
||||||
pushClass(body, show);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
(function toggleForm() {
|
|
||||||
if(button) {
|
|
||||||
button.addEventListener('click', function() {
|
|
||||||
modifyClass(form, open);
|
|
||||||
modifyClass(this, toggled);
|
|
||||||
this.textContent = containsClass(this, toggled) ? 'cancel' : 'comment';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
function elemAttribute(elem, attr, value = null) {
|
|
||||||
if (value) {
|
|
||||||
elem.setAttribute(attr, value);
|
|
||||||
} else {
|
|
||||||
value = elem.getAttribute(attr);
|
|
||||||
return value ? value : false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(function(){
|
|
||||||
let links = document.querySelectorAll('a');
|
|
||||||
if(links) {
|
|
||||||
Array.from(links).forEach(function(link){
|
|
||||||
let target, rel, blank, noopener, attr1, attr2, url, isExternal;
|
|
||||||
url = elemAttribute(link, 'href');
|
|
||||||
isExternal = (url && typeof url == 'string' && url.startsWith('http')) && !containsClass(link, 'nav_item') && !isChild(link, '.post_item') && !isChild(link, '.pager') ? true : false;
|
|
||||||
if(isExternal) {
|
|
||||||
target = 'target';
|
|
||||||
rel = 'rel';
|
|
||||||
blank = '_blank';
|
|
||||||
noopener = 'noopener';
|
|
||||||
attr1 = elemAttribute(link, target);
|
|
||||||
attr2 = elemAttribute(link, noopener);
|
|
||||||
|
|
||||||
attr1 ? false : elemAttribute(link, target, blank);
|
|
||||||
attr2 ? false : elemAttribute(link, noopener, noopener);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
let headingNodes = [], results, link, icon, current, id,
|
|
||||||
tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
|
||||||
|
|
||||||
|
|
||||||
current = document.URL;
|
|
||||||
|
|
||||||
tags.forEach(function(tag){
|
|
||||||
results = document.getElementsByTagName(tag);
|
|
||||||
Array.prototype.push.apply(headingNodes, results);
|
|
||||||
});
|
|
||||||
|
|
||||||
headingNodes.forEach(function(node){
|
|
||||||
link = createEl('a');
|
|
||||||
icon = createEl('img');
|
|
||||||
icon.src = 'http://localhost:1313/images/icons/link.svg';
|
|
||||||
link.className = 'link';
|
|
||||||
link.appendChild(icon);
|
|
||||||
id = node.getAttribute('id');
|
|
||||||
if(id) {
|
|
||||||
link.href = `${current}#${id}`;
|
|
||||||
node.appendChild(link);
|
|
||||||
pushClass(node, 'link_owner');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const copyToClipboard = str => {
|
|
||||||
// Create a <textarea> element
|
|
||||||
const el = createEl('textarea');
|
|
||||||
// Set its value to the string that you want copied
|
|
||||||
el.value = str;
|
|
||||||
// Make it readonly to be tamper-proof
|
|
||||||
el.setAttribute('readonly', '');
|
|
||||||
// Move outside the screen to make it invisible
|
|
||||||
el.style.position = 'absolute';
|
|
||||||
el.style.left = '-9999px';
|
|
||||||
// Append the <textarea> element to the HTML document
|
|
||||||
document.body.appendChild(el);
|
|
||||||
// Check if there is any content selected previously
|
|
||||||
const selected =
|
|
||||||
document.getSelection().rangeCount > 0
|
|
||||||
? document.getSelection().getRangeAt(0) // Store selection if found
|
|
||||||
: false; // Mark as false to know no selection existed before
|
|
||||||
el.select(); // Select the <textarea> content
|
|
||||||
document.execCommand('copy'); // Copy - only works as a result of a user action (e.g. click events)
|
|
||||||
document.body.removeChild(el); // Remove the <textarea> element
|
|
||||||
if (selected) { // If a selection existed before copying
|
|
||||||
document.getSelection().removeAllRanges(); // Unselect everything on the HTML document
|
|
||||||
document.getSelection().addRange(selected); // Restore the original selection
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(function copyHeadingLink() {
|
|
||||||
let deeplinks = document.querySelectorAll;
|
|
||||||
let deeplink = 'link';
|
|
||||||
if(deeplinks) {
|
|
||||||
document.body.addEventListener('click', function(event)
|
|
||||||
{
|
|
||||||
let target = event.target;
|
|
||||||
if (target.classList.contains(deeplink) || target.parentNode.classList.contains(deeplink)) {
|
|
||||||
event.preventDefault();
|
|
||||||
let newLink = target.href != undefined ? target.href : target.parentNode.href;
|
|
||||||
copyToClipboard(newLink);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function copyLinkToShare() {
|
|
||||||
let copy, copied, excerpt, isCopyIcon, isInExcerpt, link, page, postCopy, postLink, target;
|
|
||||||
copy = 'copy';
|
|
||||||
copied = 'copy_done';
|
|
||||||
excerpt = 'excerpt';
|
|
||||||
postCopy = 'post_copy';
|
|
||||||
postLink = 'post_card';
|
|
||||||
page = document.documentElement;
|
|
||||||
|
|
||||||
page.addEventListener('click', function(event) {
|
|
||||||
target = event.target;
|
|
||||||
isCopyIcon = containsClass(target, copy);
|
|
||||||
isInExcerpt = containsClass(target, postCopy);
|
|
||||||
if (isCopyIcon) {
|
|
||||||
if (isInExcerpt) {
|
|
||||||
link = target.closest(`.${excerpt}`).previousElementSibling;
|
|
||||||
link = containsClass(link, postLink)? elemAttribute(link, 'href') : false;
|
|
||||||
} else {
|
|
||||||
link = window.location.href;
|
|
||||||
}
|
|
||||||
if(link) {
|
|
||||||
copyToClipboard(link);
|
|
||||||
pushClass(target, copied);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
@ -1 +0,0 @@
|
|||||||
{"Target":"js/index.js","MediaType":"application/javascript","Data":{}}
|
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
{"Target":"main.d67221038b4e9b75d0e61a1348f203060d2f5f3fc1c89991ee75c321c55bc33512fd1b820a1c4684f0f7437f6b427b2b287be311f536db8916260cefb431e54a.css","MediaType":"text/css","Data":{"Integrity":"sha512-1nIhA4tOm3XQ5hoTSPIDBg0vXz/ByJmR7nXDIcVbwzUS/RuCChxGhPD3Q39rQnsrKHvjEfU224kWJgzvtDHlSg=="}}
|
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
{"Target":"css/main.34c570a3a70342bd493da22fe29cbc6662935af7011e94e7302b7422bf26594908393627b6e3efbf8e5dd9875b52386cc4825640896de1371e07e62f774e7b69.css","MediaType":"text/css","Data":{"Integrity":"sha512-NMVwo6cDQr1JPaIv4py8ZmKTWvcBHpTnMCt0Ir8mWUkIOTYntuPvv45d2YdbUjhsxIJWQIlt4TceB+Yvd057aQ=="}}
|
|
Binary file not shown.
Before Width: | Height: | Size: 109 KiB |
Binary file not shown.
Before Width: | Height: | Size: 272 KiB |
@ -1,31 +0,0 @@
|
|||||||
# Edit accordingly
|
|
||||||
comments:
|
|
||||||
allowedFields: ["name", "email", "comment"]
|
|
||||||
allowedOrigins: ["localhost", "example.com"]
|
|
||||||
branch: "master" # should match your config.toml
|
|
||||||
filename: "comment-{@date:YYYY-MM-DDTHH-mm-ss.SSS}"
|
|
||||||
format: "yaml"
|
|
||||||
commitMessage: "New Staticman comment in {options.slug}"
|
|
||||||
generatedFields:
|
|
||||||
date:
|
|
||||||
type: date
|
|
||||||
options:
|
|
||||||
format: "iso8601"
|
|
||||||
moderation: false
|
|
||||||
name: "Fancy Site Title"
|
|
||||||
path: "data/comments/{options.slug}"
|
|
||||||
requiredFields: ["name", "email", "comment"]
|
|
||||||
transforms:
|
|
||||||
email: md5
|
|
||||||
|
|
||||||
# reCAPTCHA (OPTIONAL)
|
|
||||||
# Register your domain at https://www.google.com/recaptcha/ and choose reCAPTCHA V2
|
|
||||||
# Use your OWN siteKey and secret.
|
|
||||||
reCaptcha:
|
|
||||||
enabled: false
|
|
||||||
# siteKey and secret should match your config.toml
|
|
||||||
#siteKey: "6Lcv8G8UAAAAAEqV1Y-XEPum00C_DxhD6O--qkFo"
|
|
||||||
# (!) ENCRYPT reCaptcha secret key using Staticman /encrypt endpoint
|
|
||||||
# i.e. https://{staticman-endpoint}/v3/encrypt/{your-site-secret}
|
|
||||||
# For more information, https://staticman.net/docs/encryption
|
|
||||||
#secret: "p5uHlH9hCqpMJaGKXdt5MEWFo7K6fX8hoYUwR3aIafOI6rtItLauaDCkGOucysJtrVZy+sHffioGzMsOU64JFDSyPQgrXujegcOHFRXHhD4fOUuBXSvV+OZ8JhSPTGWaRcQcoiGX4pT5hlebLddOl59b6sn6kU1ODQcEbhP83xVLZlaTWOrNrF5Wvy3TMXpH5gyl1tZEORxADAShMYyUbNR7XZYLEg1DfgIBHfIg3cKwdFt7KVLejFGKIiBYRAZDE2JuHItNmzJ2x9JgSK3E+XnShV5tuWpncnyFonJVHGEky/zRfUVLHobDMcJ/u9nlZqE8u47W+833F1WaIYuwNw=="
|
|
Binary file not shown.
Before Width: | Height: | Size: 46 KiB |
Binary file not shown.
Before Width: | Height: | Size: 109 KiB |
Binary file not shown.
Before Width: | Height: | Size: 272 KiB |
@ -1,6 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
<div class = 'center wrap'>
|
|
||||||
<h1 class = 'mt'>404</h1>
|
|
||||||
<p class = 'pale'>Uh-Oh, that page doesn't exist</p>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
@ -1,11 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang='{{ .Lang }}'>
|
|
||||||
{{ partial "head.html" . }}
|
|
||||||
<body>
|
|
||||||
{{ partial "nav.html" . }}
|
|
||||||
<main>
|
|
||||||
{{ block "main" . }}{{ end }}
|
|
||||||
</main>
|
|
||||||
{{ partial "footer.html" . }}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,3 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
{{ partial "archive.html" . }}
|
|
||||||
{{ end }}
|
|
@ -1,23 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
{{ $bgImage := ( absURL (printf "images/%s" .Params.image) ) }}
|
|
||||||
<section class = 'post_header' style = 'background-image:url({{ $bgImage }});'>
|
|
||||||
<h1 class='post_title' itemprop='name headline'>{{ .Title }}</h1>
|
|
||||||
</section>
|
|
||||||
<div class = 'post'>
|
|
||||||
<article class='post_content'>
|
|
||||||
{{ .Content }}
|
|
||||||
<div class = 'post_extra'>
|
|
||||||
<div class = 'copy'></div>
|
|
||||||
</div>
|
|
||||||
{{ partial "author.html" . }}
|
|
||||||
</article>
|
|
||||||
{{ if .Site.Params.Staticman }}
|
|
||||||
{{ partial "comments.html" . }}
|
|
||||||
{{ end }}
|
|
||||||
<aside>
|
|
||||||
{{ partial "aside.html" . }}
|
|
||||||
</aside>
|
|
||||||
</div>
|
|
||||||
<script src = '{{ absURL "js/autosize.min.js" }}'></script>
|
|
||||||
<script src = '{{ absURL "js/timeago.js" }}'></script>
|
|
||||||
{{ end }}
|
|
@ -1,3 +0,0 @@
|
|||||||
{{ define "main" }}
|
|
||||||
{{ partial "archive.html" . }}
|
|
||||||
{{ end }}
|
|
@ -1,9 +0,0 @@
|
|||||||
{{- with .Site.Params.ga_analytics }}
|
|
||||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
|
|
||||||
<script>
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
function gtag(){dataLayer.push(arguments);}
|
|
||||||
gtag('js', new Date());
|
|
||||||
gtag('config', '{{ . }}');
|
|
||||||
</script>
|
|
||||||
{{ end -}}
|
|
@ -1,7 +0,0 @@
|
|||||||
{{ partial "intro.html" . }}
|
|
||||||
<ul class='posts wrap' id = 'posts'>
|
|
||||||
{{- range .Paginator.Pages }}
|
|
||||||
{{ partial "excerpt.html" . }}
|
|
||||||
{{- end }}
|
|
||||||
</ul>
|
|
||||||
{{ partial "pager.html" . }}
|
|
@ -1,13 +0,0 @@
|
|||||||
<h3>Recent Posts</h3>
|
|
||||||
<ul class='posts aside'>
|
|
||||||
<!-- filter array of posts with the first tag of this post (related) -->
|
|
||||||
<!-- if post doesn't have any tags use RegularPages -->
|
|
||||||
<!-- filter out the current post -->
|
|
||||||
<!-- return atmost 2 posts -->
|
|
||||||
{{ $title := .Params.title }}
|
|
||||||
{{ range first 2 .Site.RegularPages }}
|
|
||||||
{{ if not (eq .Title $title) }}
|
|
||||||
{{ partial "excerpt.html" . }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
</ul>
|
|
@ -1,5 +0,0 @@
|
|||||||
<div class = 'waves'>
|
|
||||||
<canvas id = 'waves' class = 'waves_inner'></canvas>
|
|
||||||
</div>
|
|
||||||
<script src = '{{ absURL "js/sine-waves.min.js" }}'></script>
|
|
||||||
<script src = '{{ absURL "js/audio.js" }}'></script>
|
|
@ -1,16 +0,0 @@
|
|||||||
{{ $author := (lower .Params.author) }}
|
|
||||||
{{ $reading := .ReadingTime }}
|
|
||||||
{{ range .Site.Data.authors }}
|
|
||||||
{{ if eq .name $author }}
|
|
||||||
<div class = 'author'>
|
|
||||||
<a href = '{{ .url }}' target = "{{ $author }}'s profile">
|
|
||||||
<img class = 'author_pic' src = '{{ absURL (printf "images/%s.jpg" $author) }}' alt = ''>
|
|
||||||
</a>
|
|
||||||
<div class = 'author_meta'>
|
|
||||||
<div class = 'pale author_heading'>WRITTEN BY</div>
|
|
||||||
<a class = 'author_name' href = '{{ .url }}' title = "{{ $author }}'s Profile">{{ .name }}</a>
|
|
||||||
</div>
|
|
||||||
<p class = 'pale author_bio solo'>{{ .bio }}</p>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
@ -1,30 +0,0 @@
|
|||||||
{{ $vs := .Site.Params.staticman }}
|
|
||||||
<span class = 'form_toggle btn'>Comment</span>
|
|
||||||
<form method = 'POST' action = '{{ $vs.endpoint | default "https://api.staticman.net" }}/v3/entry/{{ $vs.gitProvider }}/{{ $vs.username }}/{{ $vs.repository }}/{{ $vs.branch }}/comments' class = 'form form-comments' id = 'comments-form'>
|
|
||||||
<input name = 'options[slug]' type = 'hidden' value = '{{ md5 .File.Path }}'>
|
|
||||||
{{- if $vs.reCaptcha -}}
|
|
||||||
<input name = 'options[reCaptcha][siteKey]' type = 'hidden' value = '{{ $vs.reCaptcha.siteKey }}'>
|
|
||||||
<input name = 'options[reCaptcha][secret]' type = 'hidden' value = '{{ $vs.reCaptcha.secret }}'>
|
|
||||||
{{- end -}}
|
|
||||||
<label class = 'form_label'>Name</label>
|
|
||||||
<input name = 'fields[name]' type = 'text' placeholder = 'Name' class = 'form_input' required>
|
|
||||||
<label class = 'form_label'>E-mail</label>
|
|
||||||
<input name = 'fields[email]' type = 'email' placeholder = 'Email' class = 'form_input' required>
|
|
||||||
<label class = 'form_label'>Comment</label>
|
|
||||||
<textarea name = 'fields[comment]' placeholder = 'Type in a comment ...' class = 'form_input form_input-message' required></textarea>
|
|
||||||
|
|
||||||
{{- if $vs.reCaptcha -}}
|
|
||||||
<div class = 'g-recaptcha' data-sitekey = '{{ $vs.reCaptcha.siteKey }}' data-callback='enableSubmitComment'></div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
function enableSubmitComment(){
|
|
||||||
document.getElementById('submitComment').disabled = false;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script async src = 'https://www.google.com/recaptcha/api.js'></script>
|
|
||||||
{{- end -}}
|
|
||||||
<div>
|
|
||||||
<input type = 'submit' id = 'submitComment' value = 'Comment' class = 'btn form_input-submit' {{- if $vs.reCaptcha }} disabled {{- end }}>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
@ -1,31 +0,0 @@
|
|||||||
<h3>Comments</h3>
|
|
||||||
<div class = 'comments'>
|
|
||||||
{{ $.Scratch.Add "hasComments" 0 }}
|
|
||||||
{{ $entryId := md5 .File.Path }}
|
|
||||||
{{ if .Site.Data.comments }}
|
|
||||||
{{ range $index, $comments := (index $.Site.Data.comments $entryId ) }}
|
|
||||||
{{ $.Scratch.Add "hasComments" 1 }}
|
|
||||||
<div class = 'comment'>
|
|
||||||
<img src = 'https://www.gravatar.com/avatar/{{ .email }}?s=100' alt = 'user icon' class = 'comment_pic'>
|
|
||||||
<div class = 'comment_meta'>
|
|
||||||
<div class = 'comment_heading pale' data-time = '{{ .date }}'></div>
|
|
||||||
<div class = 'comment_author comment_name'>{{ .name }}</div>
|
|
||||||
</div>
|
|
||||||
<p class = 'solo comment_bio pale'>{{ .comment | markdownify }}</p>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ if eq ($.Scratch.Get "hasComments") 0 }}
|
|
||||||
<p>Nothing yet.</p>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ partial "comments-form.html" . }}
|
|
||||||
<article class = 'modal'>
|
|
||||||
<div class = 'modal_inner'>
|
|
||||||
<h2 class = 'modal_title'></h2>
|
|
||||||
<div class = 'modal_text'></div>
|
|
||||||
<button class = 'modal_close'>Close</button>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
</div>
|
|
@ -1,22 +0,0 @@
|
|||||||
<li class = 'post_item'>
|
|
||||||
<a class = 'post_card' href='{{ .RelPermalink }}' title = '{{ .Title }}'>
|
|
||||||
<img class = 'post_thumbnail' src='{{ path.Join "images" .Params.image | absLangURL }}'>
|
|
||||||
</a>
|
|
||||||
<div class = 'excerpt'>
|
|
||||||
<div class = 'excerpt_meta'>
|
|
||||||
{{ with .Params.tags -}}
|
|
||||||
{{ range first 1 . }}
|
|
||||||
{{ $tag := . | urlize }}
|
|
||||||
<a href = '{{ absURL (printf "tags/%s" $tag) }}' class = 'post_tag'>
|
|
||||||
{{ . }}
|
|
||||||
</a>
|
|
||||||
{{ end }}
|
|
||||||
{{- end }}
|
|
||||||
<div class = 'post_copy copy'></div>
|
|
||||||
</div>
|
|
||||||
<h3 class = 'post_link'>
|
|
||||||
<a href='{{ .RelPermalink }}'>{{ .Title }}</a>
|
|
||||||
</h3>
|
|
||||||
<p class = 'pale'>{{ .Summary | truncate 90 }}</p>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
@ -1,7 +0,0 @@
|
|||||||
<link rel='apple-touch-icon' sizes='180x180' href='{{ absURL "images/icons/apple-touch-icon.png" }}'>
|
|
||||||
<link rel='icon' type='image/png' sizes='32x32' href='{{ absURL "images/icons/favicon-32x32.png" }}'>
|
|
||||||
<link rel='icon' type='image/png' sizes='16x16' href='{{ absURL "images/icons/favicon-16x16.png" }}'>
|
|
||||||
<link rel='manifest' href='{{ absURL "images/icons/site.webmanifest" }}'>
|
|
||||||
<link rel='mask-icon' href='{{ absURL "images/icons/safari-pinned-tab.svg" }}' color='#5bbad5'>
|
|
||||||
<meta name='msapplication-TileColor' content='#da532c'>
|
|
||||||
<meta name='theme-color' content='#ffffff'>
|
|
@ -1,8 +0,0 @@
|
|||||||
<footer class = 'footer'>
|
|
||||||
<div class = 'footer_inner wrap pale'>
|
|
||||||
<p>© <span class = 'year'></span> {{ .Site.Title }}</p>
|
|
||||||
<p>Designed by <a href = '{{ .Site.Data.designer.url }}' target = '_blank' title = 'Linkedin Profile' rel = 'nonopener'> {{ .Site.Data.designer.name }}</a></p>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
{{ $scripts := resources.Get "js/index.js" | resources.ExecuteAsTemplate "js/index.js" . }}
|
|
||||||
<script src = '{{ $scripts.Permalink }}'></script>
|
|
@ -1,17 +0,0 @@
|
|||||||
<head>
|
|
||||||
<title>{{ with .Title }}{{ humanize . }} | {{ end }}{{ .Site.Title }}</title>
|
|
||||||
<meta charset='utf-8'>
|
|
||||||
{{- with .Site.Params.ga_verify }}
|
|
||||||
<meta name="google-site-verification" content="{{ . }}" />
|
|
||||||
{{- end }}
|
|
||||||
<meta name = 'viewport' content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'>
|
|
||||||
<meta http-equiv = 'X-UA-Compatible' content = 'IE=edge'>
|
|
||||||
<meta name = 'SKYPE_TOOLBAR' content = 'SKYPE_TOOLBAR_PARSER_COMPATIBLE' />
|
|
||||||
{{- partial "analytics.html" . }}
|
|
||||||
{{- partial "opengraph.html" . }}
|
|
||||||
{{- partial "favicon.html" . }}
|
|
||||||
<link rel='canonical' href='{{ .Permalink }}'>
|
|
||||||
{{- $options := (dict "targetPath" "css/main.css" "outputStyle" "expanded" "enableSourceMap" "true") -}}
|
|
||||||
{{- $styles := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "scss/main.scss" . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
|
|
||||||
<link rel = 'stylesheet' href = '{{ $styles.Permalink }}' integrity = '{{ $styles.Data.Integrity }}'>
|
|
||||||
</head>
|
|
@ -1,8 +0,0 @@
|
|||||||
<header class = 'nav' >
|
|
||||||
<nav class = 'nav-menu'>
|
|
||||||
<a href='{{ absURL "" }}' class = 'nav-brand nav_item'>{{ .Site.Title }}</a>
|
|
||||||
<div class = 'nav_bar-wrap'>
|
|
||||||
<div class = 'nav_bar'></div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
@ -1,8 +0,0 @@
|
|||||||
<!-- intro banner on list pages -->
|
|
||||||
<section class = 'intro'>
|
|
||||||
<div class = 'intro_inner'>
|
|
||||||
<div>{{ partial "audio.html" . }}</div>
|
|
||||||
<h1 class = 'intro_headline'>{{ .Title }}</h1>
|
|
||||||
<p class = 'intro_desc'>{{ .Description }}</p>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
@ -1,9 +0,0 @@
|
|||||||
<div class = 'nav-drop'>
|
|
||||||
<div class = 'nav-body'>
|
|
||||||
{{ range .Site.Data.menu }}
|
|
||||||
<a href = '{{ absURL .url }}' class = 'nav_item'>{{ .item }}</a>
|
|
||||||
{{ end }}
|
|
||||||
<div class = 'nav-close'></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ partial "header.html" . }}
|
|
@ -1,49 +0,0 @@
|
|||||||
<meta name = 'keywords' content = '{{ .Site.Title }}'>
|
|
||||||
<meta property = 'og:locale' content = 'en_US' />
|
|
||||||
<meta property = 'og:type' content = 'article' />
|
|
||||||
<meta property = 'og:title' content = '{{ .Title }}' />
|
|
||||||
<meta property = 'og:description' content = '{{ with .Summary}}{{ . | truncate 150 }}{{ else }}{{ .Site.Params.description }}{{ end }}'>
|
|
||||||
<meta property = 'og:url' content = '{{ .Permalink }}' />
|
|
||||||
{{- with .Params.image }}
|
|
||||||
<meta property = 'og:image' content = '{{ absURL (printf "images/%s" .) }}'/>
|
|
||||||
{{- else }}
|
|
||||||
<meta property = 'og:image' content = '{{ absURL (printf "images/%s" .Site.Params.logo) }}'/>
|
|
||||||
{{- end }}
|
|
||||||
{{- if eq .Section "blog" -}}
|
|
||||||
{{- $date := ( .Date.Format "2006-02-01") -}}
|
|
||||||
<meta property = 'article:published_time' content = '{{ htmlUnescape $date }}' />
|
|
||||||
<script type = "application/ld+json">
|
|
||||||
{
|
|
||||||
"@context": "http://schema.org",
|
|
||||||
"@type": "BlogPosting",
|
|
||||||
"mainEntityOfPage":"{{ .Permalink }}",
|
|
||||||
"name": "{{ .Site.Title }}",
|
|
||||||
"headline": "{{ .Title }}",
|
|
||||||
"description": "{{ htmlUnescape (.Summary | truncate 150) }}",
|
|
||||||
"url": "{{ .Permalink }}",
|
|
||||||
"datePublished": "{{ $date }}",
|
|
||||||
"dateModified": "{{ $date }}",
|
|
||||||
"author": {
|
|
||||||
"@type": "Person",
|
|
||||||
"name": "{{ .Params.author }}"
|
|
||||||
},
|
|
||||||
"image":{
|
|
||||||
"@type":"ImageObject",
|
|
||||||
"url": "{{ absURL (printf "images/%s" .Params.image ) }}"
|
|
||||||
},
|
|
||||||
"publisher": {
|
|
||||||
"@type": "Organization",
|
|
||||||
"logo": {
|
|
||||||
"@type":"ImageObject",
|
|
||||||
"url": "{{ absURL (printf "images/%s" .Site.Params.logo) }}"
|
|
||||||
},
|
|
||||||
"name": "{{ .Site.Title }}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<meta name = 'twitter:card' content = 'summary_large_image' />
|
|
||||||
<meta name = 'twitter:creator' content = '{{ .Site.Params.twitter }}'>
|
|
||||||
<meta name = 'twitter:title' content = '{{ .Title }}' />
|
|
||||||
<meta property = 'twitter:description' content = '{{ .Summary | truncate 250 }}'/>
|
|
||||||
<meta name = 'twitter:image' content = '{{ absURL (printf "images/%s" .Params.image) }}' />
|
|
||||||
{{- end }}
|
|
@ -1,20 +0,0 @@
|
|||||||
{{- $paginator := .Paginator }}
|
|
||||||
{{- if gt $paginator.TotalPages 1 }}
|
|
||||||
<div class = 'pager'>
|
|
||||||
<!-- {{ if $paginator.HasPrev }}
|
|
||||||
<a href = '{{ $paginator.Prev.URL }}' class = ' pager_item pager_prev'></a>
|
|
||||||
{{ else }}
|
|
||||||
<span class = ' pager_item pager_active pager_prev'></span>
|
|
||||||
{{- end }} -->
|
|
||||||
|
|
||||||
{{ range $paginator.Pagers -}}
|
|
||||||
<a href="{{ .URL }}" class = 'pager_item{{ if eq . $paginator }} pager_active{{ end }}'>{{ .PageNumber }}</a>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
<!-- {{- if $paginator.HasNext -}}
|
|
||||||
<a href = '{{ $paginator.Next.URL }}' class = ' pager_item pager_next'></a>
|
|
||||||
{{ else -}}
|
|
||||||
<span class = ' pager_item pager_active pager_next'></span>
|
|
||||||
{{ end }} -->
|
|
||||||
</div>
|
|
||||||
{{- end }}
|
|
@ -1,4 +0,0 @@
|
|||||||
{{ $url := .Get 0 }}
|
|
||||||
<div class = 'video'>
|
|
||||||
<iframe src='https://www.youtube.com/embed/{{ $url }}?controls=1&rel=0'></iframe>
|
|
||||||
</div>
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user