>... I’ve chosen the manual route as far as category front matter is concerned.
Jekyll has Front Matter defaults for this case. They allow you to set defaults for each file at a given path. I think they would also help here, e.g.:
# in your config.yaml
defaults: - scope: path: "_posts/pictures" values: category: "pictures"
Check your ruby versions. Cronjobs don't start with same environment variables or PATH as your shell. Run which ruby > /tmp/run.txt
in your cron to see which ruby is running in your cron.
See https://stackoverflow.com/questions/2388087/how-to-get-cron-to-call-in-the-correct-paths for example
Not quite - looks like you need to brush up on what a static site generator does. With Jekyll, you make all of your changes offline on your machine. Then, you run 'jekyll build' in your terminal, and Jekyll generates for you a website that you upload to a server. Check it out: https://jekyllrb.com/docs/usage/
It's generally convenient enough to make a change and upload your WHOLE site each time, just to make sure every page is updated correctly.
It's really simple once you get the hang of it :)
> When I build my site locally, within the folder for the theme,
Um, u wot m8?
So, when you create a new jekyll repo--usually with jekyll create mynewsite
, a directory is created with the following:
_posts .gitignore 404.html about.md Gemfile Gemfile.lock index.md _config.yml
When you build, you build from this folder, and _site
will appear here. If you build from another folder, things won't work as expected.
When using GitHub Pages, you only have a few themes to choose from. You'll specify the theme in _config.yml
.
When you're not constrained by GitHub Pages, the modern jekyll way to install themes is by installing a gem.
I say all this because it sounds like you might be building in the wrong directory or placing a custom theme wrongly. Either way, try building a site with the default theme or one of the GitHub-supported ones and see if it looks better.
Sounds like you need submodules.
However cute submodules may seem... they can easily turn into confusing, nasty, little monsters.
There are three rules: (1) no bright light, (2) don't get your submodule wet, and (3) never feed him after midnight, no matter how much he begs.
You and your team have been warned!
There are other Git based workarounds for this kind of thing, but I have not tried any of them.
No I mean if you're fulfilling this https://f-droid.org/wiki/page/Inclusion_How-To it's probably worth submitting to F-Droid via their forum so your app will be in their repo. There's a small but dedicated following of F-droid users, largely geeks
https://www.goatcounter.com/ uses javascript. But they claim they are" Privacy-aware; doesn’t track users with unique identifiers and doesn't need a GDPR notice "
Didn't try yet, but I will soon, seems promising.
If Gitlab pages is not a must for you, then I advise you to try Netlify. I have blogs on private repositories in Gitlab, but they are served by Netlify (free account). I must say I'm more than satisfied with their service. Continuous deployment and always online...
Note: I'm not affiliated with them in any way, just a happy user.
Yes, you can serve your website from a private GitHub repo using GitHub pages (free!) and use a custom domain address. That is how I have my personal blog setup now. I have a post with instructions :)
https://davidjchambers.com/2017/12/27/site-setup.html
See the ‘Custom Domain and Hosting’ section.
If you don’t want to use GitHub pages there are a slew of other providers where you can host your site
You can get all nerdy and set up automatic deployment via a CI, but you're probably not working at a scale where that's needed. Copying the rendered files will be good enough for a basic website and host it on the cheap at any number of web hosts.
Late comment, but I would follow this guide:
https://jekyllrb.com/docs/pagination/
It's fairly simple to set up and works on Github pages.
(I have it set up on my personal site which runs on GitHub pages)
> Hm, yeah it might be in how jekyll processes the markdown?
No, this is in the kramdown itself. Checked with online kramdown.
> There are limits to it, and so for more advanced formatting I think you and I both need to look into the includes (and passing parameters into them) thing.
The best I think I could do was to look inside actual Jekyll code - this page and it's source - they don't do any includes - they just paste raw HTML, seems there is no better way.
Okay so I dont have live code but I looked over the 2016 page and generated this bit for you to try out. I believe it should have no problems, but you can likely do things a bit better.
The idea I went with was to indicate in the frontmatter that would use a default layout but this one would be for a given year, or can be applied as defaults to each page for this year, or even, through the _config.yml defaults settings documented here
year: 2016
nav:
title: meeting main page
path: / - label: location
path: /location.shtml - label: programme
path: /pr2016.pdf - label: abstracts
path: /abstracts.shtml - label: fee
path: /fee.shtml - label: registration
title: register
path: /registration.shtml - label: links
path: /links.shtml
The layout page this would affect can look like so:
{% capture yearSubPath %}/{{page.year}}{% endcapture %} <div id="top-two"> {% for link in page.nav %} <a href="{{link.path | prepend: yearSubPath}}" title="{{ link.title | default: link.label }}">{{link.label}}</a>" " {% endfor %} </div>
Hello, building (static) website, books, presentations, radio shows, and more with jekyll? Let's make jekyll 4.0 better, faster, ....! Yes, you can!
To quote Olivia Hugger (@dog_awoo), the Jekyll Open Source Project Lead writes:
> Now is a great time to finally take on the feature you’ve wanted to see in Jekyll for ages! > Just open an issue or experiment with the code to get going! > > (Source: Jekyll 4.0 is on the Horizon!)
Happy Jekylling. Cheers. Prost.
Twig was designed to resemble Django and Jinja, which is also what guided Liquid - https://www.quora.com/Was-Twigs-syntax-inspired-by-Liquid
Maybe, maybe, maybe https://github.com/jekyll/jekyll-gist ?
It's listed as a dependency on GitHub pages https://pages.github.com/versions/ if that's where you are hosting the blog.
Also may try a git submodule or git tree of the code repo in your Jekyll repo?
The main page is not that big of an issue. Most of the pages with less content are also showing the same result.
A month later, here's another idea. I just learned of AWS Lambda which lets you run JavaScript, Python or Java code as a service. The first million requests per month and 3.2 million seconds' compute time per month is free.
I have really no idea yet how to combine this with GitHub Pages, but it looks like I can define a REST API for Lambda so the code can be run via HTTPS. Could be a fun project. To keep it free, would probably have to be a low-volume site and would probably have to have all the data on GH Pages.
I did create a Lambda function from a dev kit for add-on features for my Amazon Echo, but I haven't made an HTTPS-accessible function yet.
Just to clarify, you probably don't want to serve your blog from EC2. Jekyll creates a static website, so once it generates the static files for you, you can host it anywhere. The jekyll serve
function is meant for your own development, but you wouldn't want users to access your Jekyll site through it.
Are you familiar with SSH? The best thing to do is to SSH into your EC2 instance and port forward 4000 to your local machine:
ssh yourusername@your-ec2-public-ip -L 4000:localhost:4000
Then if you access http://localhost:4000 from your local machine, you'll see your Jekyll site.
When you want to publish, I recommend using Github Pages. It's simple, free, and supports Jekyll natively.
Don't worry about things like this and just use Cloudinary. Their free tier is generous enough.
You can use the picture tag to art direct the image for different screens resolutions, then leverage Cloudinary's on the fly image transforms to give you the image you need.
htpasswd is a standard basic auth (setup with apache in my case http://httpd.apache.org/docs/current/howto/auth.html), and once you do an ajax request to the secured page with the username and password (see first code snippet) then it will actually be saved by the browser in some fashion and be used on all subsequent page visits. it is actually kind of silly because to log out, you just have to send bogus username and password to a secured page (can also do this via ajax though so user doesnt notice)
the htpasswd approach does have some server backend so this approach cant necessarily be used on github pages for example, but it is a nice lightweight auth approach
CI servers build your site/app/project on a continuous basis. You can run a self-hosted one like Jenkins, or use a service like Circle CI, Codeship, or Travis CI.
http://programmers.stackexchange.com/questions/198471/simple-explanation-of-continuous-integration
The _site
folder is overwritten by building the main folder so I don't care much about cloning it. When i run jekyll build on my main folder (gh-pages
branch), it fills its _site
folder (master
branch). So I would only move the main folder and jekyll build
it to recreate _site.
I got this idea from this sitepoint post: go down and look at wejrowski's comment (i think its exactly what I did). Let me know if you want to see my two branches and I'll PM links to you.
I have 69/100 on Mobile and 88/100 on Desktop. The stuff I'm having problems is not easy to me, to be honest.
How does your site rate?
No, it's not one of GitHub Pages' supported plugins. I use Netlify, which supports it quite nicely. And, while there is some documentation, it does take a bit of figuring out.
I've used cognito forms in the past but they're a bit business-y, have you tried hosting with Netlify?
They have the facility to manage form submissions for you and it's kindof magic
https://www.netlify.com/products/forms/
You can look a little bit here, where for free accounts they specify the quotas:
> Network Bandwidth: 100GB/month — Soft
> Storage: 100GB — Soft
> API requests: 500 requests/minute, 3 deploys/minute* — Hard
They are so easy to use. Just try them. And even configuring your own domain is very easy.
Put two spaces at the end of the line.
"this is line 1
this is line 2
this is line 3"
It's Markdown, it works the same way as Reddit comments.
Documentation is available here, by clicking 'formatting help' on any Reddit page, or on the Jekyll website.
You can make new files or edit existing in the GitLab ui on mobile, no other tools needed
Feature Highlight: Create files and directories from the Files page
THX for this hint. Do you have experience with deploying Jekyll pages with Gitlab? I have created private repo, pushed one of the templates, created .gitlab-ci.yml configuration file from their tutorial: https://about.gitlab.com/2016/04/07/gitlab-pages-setup/#step-by-step with the code:
# requiring the environment of Ruby 2.3.x image: ruby:2.3
# add bundle cache to 'vendor' for speeding up builds cache: paths: - vendor/
before_script: - bundle install --path vendor
# the 'pages' job will deploy and build your site to the 'public' path pages: stage: deploy script: - bundle exec jekyll build -d public/ artifacts: paths: - public only: - master # this job will affect only the 'master' branch
and clicked CI / CD > Run Pipeline. It created some job called Deploy, but it is constantly on "pending" status. I left it overnight, but still "pending". Am I doing it wrong?
I don't know if this is the *best* way but one way to do this would be to put your script into an html file and include that file with the image list passed as an argument. Details at https://jekyllrb.com/docs/includes/#passing-parameters-to-includes
You can do this by putting your whole HTML layout for this component into one include file and passing ContentA and ContentB as parameters as described here: https://jekyllrb.com/docs/includes/#passing-parameters-to-includes
Go through the tutorial. It teaches you how to put html into _includes so that you have just {{ content }} in the pages. Helped me when I started with Jekyll
Hasn't Jekyll have a default post collection in every site? Otherwise you will need to create your own collection https://jekyllrb.com/docs/collections/ and create a loop on the Blog page you've created getting these posts in the order you want.
Front matter defaults might be your friend. If you sort the posts into subdirectories inside _posts
, you can use the scope
key to assign tags or categories to posts depending on which directory they live in. Then, when you invoke a loop, you can filter by union, intersection, difference, etc.
Edit: formatting
yep i just push the _site
folder. however, im using cloudflare to host mine right now. the the idea is same.
jekyll build --config _config.yml
> Note that GitHub Pages works equally well for regular HTML content, simply because Jekyll treats files without front matter as static assets. So if you only need to push generated HTML, you’re good to go without any further setup.
https://jekyllrb.com/docs/github-pages/
can you explain how is it different then local? you can always verify the _site
folder locally.
Might be. I don't have any themes installed.
The code block highlighting isn't anything I made, it's how the instructions in the jekyll docs tell you how to do it: https://jekyllrb.com/docs/liquid/tags/
It did look like your screenshot had a stray '>' character in front of the code block, maybe that indicates something?
You might also check out using Bundler: https://jekyllrb.com/tutorials/using-jekyll-with-bundler/
That has helped me manage version dependency conflicts. Basically it installs all the gems (including Jekyll) in the project so you don't have version conflicts between projects and/or the base system.
Yes, I see it now. My solution worked, but I knew it was sub-optimal. I just found the doc at https://jekyllrb.com/docs/github-pages/#project-page-url-structure explaining to use your solution.
For things like this I use a snippet expander (I use TextExpander but plenty of others exist) so I can type a few characters (maybe {B}
but ;b
is even easier!) that gets expanded to whatever it is I'm too lazy to type, e.g. {% mana B %}
or even the full set of <img src="http://blah.blah.blah…
The downside is it's not tied in to your project's code so if you edit content from different computers, you won't always have access to your snippets and might sometimes have to type it all out.
A better way might be to write a pre-parser based on Jekyll hooks. I've never done this but I think you could easily write a :posts, :pre_render hook to just do a find and replace converting {W}
to either {% mana W %}
or whatever before the Markdown gets parsed.
The main difference is that with the first method your Markdown source files in _posts
will contain the expanded version, whilst in the second the source will retain your shortcuts. This will have implications if you ever wish to reuse your content in another system.
It sounds like you'd probably want to create a custom tag for this
in which case it could look something like this in practice:
{% mana white %}
or somesuch
edit: I'm a dummy, didn't read your whole post. I expect you will not find an easy way to do what you're looking for but good luck! 🙂
edit 2: you said "converter plugin" and I think you meant "tag" fwiw
Ok, then you might want to look at the configuration option for baseurl as well, check https://jekyllrb.com/docs/configuration/options/. My advice is, if you’re not sure, try deploying your pages to see what happens then add in the baseurl, rebuild and redeploy if it doesn’t work the first time.
Are you opening the index.html file directly from disk? If so, then your CSS links probably won’t work. You need to have the pages served by something. In the case of ‘jekyll serve’ Jekyll provides its own server. When you build, you’ll need to host the built pages somewhere. See https://jekyllrb.com/docs/deployment/
.md files will be compiled down to an index.html file in the /_sites folder, under its own folder. So the link to contact.md ends up being /contact (the rendered file is at /_site/contact/index.html). You can also use the Permalink in front matter to tell Jekyll where to put the page.
I've submitted a pull request with some examples of different ways to create and link to pages. You can reject the request when you are done so they don't mess up your files. They are just examples.
Ok, I think I see what you mean. That code is called Front Matter. Its the stuff in between the ---
at the top and bottom, and has its own special formatting. And then the {% include feature_row %}
is the actual layout, which is using /_includes/feature_row Liquid template. If you look in the feature_row Liquid file you'll see it loops over each item you put in the Front Matter under feature_row, and uses image_path, alt, title, url to fill in the HTML output.
Really all you need to do to make your css work is figure out what selector is applying the rule you want to override, in this case .archive__item-teaser img
and then copy that selector to the bottom of main.scss and write your new styles. With identical selectors with different styles in your css, the loading order is the tiebreaker that determines which is applied, and the styles you write at the bottom of main.scss are loaded last so they win.
Isn't this overkill? You could just define a collection https://jekyllrb.com/docs/collections/, have a site that renders all entries, and for each data that you fetch, render a markdown file for it was variables in front end matter (and any texty things or similar in content). You could have different templates to render depending on the kind of data. Your work (now) would come down to this:
​
- create a jekyll site with a collection defined for your data, and templates for it
- create a fetch script to grab data and write to markdown / static files as necessary
​
Then for the workflow it would be a simple case of running your fetch script to download data, and parse into the markdown collection files. It all could be run with continuous integration, and then pushed to where you deploy (or even back to something like GitHub pages). I really don't think you need a custom plugin, but that's just my opinion.
>You'd run the commands in the root folder. But if your system is protesting that you haven't installed jekyll, you'll need to figure out why that is. https://jekyllrb.com/docs/installation/
So I tried installing Jekyll with Home-brew & Ruby by following the directions. However when it came down to running the line gem install bundler jekyll
I get the following Error: ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
Any Ideas on what I'm doing wrong?
You'd run the commands in the root folder. But if your system is protesting that you haven't installed jekyll, you'll need to figure out why that is. https://jekyllrb.com/docs/installation/
Sometimes your system won't know how to use Jekyll. Search for "jekyll not in path" if you have installed jekyll and aren't able to get it to work. You may have to restart your terminal/shell/cmd windows if this is the case.
You should run Jekyll from the project folder (eg imranjuma.github,io
).
But it looks like you don't have Jekyll installed. You're on a mac right? Have you checked set setup docs.
What terminal are you using?
Jekyll is a static site generator i.e. it will take your content and convert it into a web-ready set of html pages.
Your content will need to be laid out as specified in the docs for directory structure. Right out of the box, jekyll will let you setup a blog style website with support for pages. It should provide you with a default theme that's decent enough. I think thats what you want. You're welcome to pick a different theme of course. You can do that by searching for jekyll themes online or once you get a better grasp of things just create one for yourself.
Github pages or metlife are just hosts for your website and will host your static website, made with jekyll or otherwise, doesn't much matter. The jekyll-theme-chooser you linked from GitHub is a gitHub-pages special feature that lets you choose a different theme from right there, so you don't have to do that manually. Ofcourse you'll then be limited to a certain set of their officially supported themes. If any of those themes suit your purpose, I'd recommend you just go with it.
Since no one else is commenting, it sounds like you’re looking for related posts type functionality based on custom criteria. I’m not sure if there’s an existing plugin you could use, but writing your own “generator” plugin would be pretty easy to do.
https://jekyllrb.com/docs/plugins/generators/
Ive done something similar in the past. If you still need help after reading the link above LMK and I’ll pull a gist together for you.
EC2 is overkill for hosting a static site. You have much cheaper options: https://jekyllrb.com/docs/deployment-methods/. Personally, I use Netlify. I used GitHub in the past, but migrated to Netlify for the SSL support.
I'd probably make a different layout for each and then either hard-code the page layout per page, do some * magic to get the defaults to line up correctly, or make subfolders and match against those for the layouts via more straightforward default path staring (https://jekyllrb.com/docs/configuration/#glob-patterns-in-front-matter-defaults)
From thw official Jekyll site:
“You include the file into an HTML file as follows:
{% include mycontent.md %}
The Markdown is not processed because first the Liquid (include tag) gets processed, inserting mycontent.md into the HTML file. Then the Markdown would get processed.
But because the content is included into an HTML page, the Markdown isn’t rendered. The Markdown filter processes content only in Markdown files.
To make the code work, use HTML formatting in includes that are inserted into HTML files.“
https://jekyllrb.com/tutorials/orderofinterpretation/
This may work for you, if you want to keep the images in a markdown file and can't use html:
{% capture myImg %}{% include mycontent.md %}{% endcapture %} {{ myImg | markdownify }}
It shouldn't be hard to adapt Dactl if you read this documentation. I followed it for a theme of my own called "Meliora" that isn't ready for prime time yet.
Newer versions of Jekyll have gem-based themes that you can override by placing replacement copies.
That link also shows how you can find the files on your machine with bundle show minima
(although I think that just broke me because of some sort of versioning hell). You don't want to alter the files in the gem location, but you can copy individual ones to your site folder to override the gem theme.
For example here is my site's _include folder. Only footer.html is there because that's the only file I wanted to modify from the in-gem version, and Jekyll uses my footer.html but the rest of minima's files.
Jekyll documentation site has an entire section on deploying your site. https://jekyllrb.com/docs/deployment-methods/
You should look at all those options and try a few.
Heck... depending on your needs... you could cut out all of the deploy process and just publish your Jekyll site for free on GitHub using GitHub Pages.
If you are running this on a development server, you likely want Jekyll to keep serving your site even after the console session is closed.
You should use this:
$ jekyll serve --detach
That command will run Jekyll in service mode, as a background process, so that it continues to serve and watch for changes even if you exit the server console and detach from the session.
Documentation Notes: "As of version 2.4, the 'serve' command will watch for changes automatically." - https://jekyllrb.com/docs/usage/
Have you tried looking into Jekyll Data Files? Just tried it on a local build and Jekyll seems to parse the HTML just fine (even adding it as a glyph ★ in the data file worked).
Assuming you are using Jekkyl's built-in syntax highlighter, it could be done by adding this to your CSS:
.highlight { border:1px solid #ccc; }