Jekyll

How can I use Jekyll with my domain, but hosted on GitHub?

时光怂恿深爱的人放手 提交于 2019-12-21 15:21:47
问题 I would like to switch from WordPress to Jekyll. I already have migrated the articles (see new Jekyll articles + rendered page and old WordPress site). Now I would like to have the old URLs: Old URL : http://martin-thoma.com/word-error-rate-calculation/ Current new URL: http://martinthoma.github.io/word-error-rate-calculation/ So this question is really only about the top level domain. My provider (called "Knallhart") should only "hold" the domain martin-thoma.com (GitHub does not offer this,

How can I use Jekyll with my domain, but hosted on GitHub?

前提是你 提交于 2019-12-21 15:21:12
问题 I would like to switch from WordPress to Jekyll. I already have migrated the articles (see new Jekyll articles + rendered page and old WordPress site). Now I would like to have the old URLs: Old URL : http://martin-thoma.com/word-error-rate-calculation/ Current new URL: http://martinthoma.github.io/word-error-rate-calculation/ So this question is really only about the top level domain. My provider (called "Knallhart") should only "hold" the domain martin-thoma.com (GitHub does not offer this,

How to detemine if jekyll running locally or in production site?

不想你离开。 提交于 2019-12-21 07:30:12
问题 There is a config param in jekyll called production_url. I can't find any information on how to use it. Ideally i would like to be able to generate permalinks with local url when it is being run with serve param and with production url when run with build param. How could I do that? 回答1: jekyll serve will call jekyll build , so you can't really use those two as a way to output different URL schemes. I built a Jekyll plugin that does this with a Liquid Filter and one user defined variable in

How to detemine if jekyll running locally or in production site?

拈花ヽ惹草 提交于 2019-12-21 07:29:11
问题 There is a config param in jekyll called production_url. I can't find any information on how to use it. Ideally i would like to be able to generate permalinks with local url when it is being run with serve param and with production url when run with build param. How could I do that? 回答1: jekyll serve will call jekyll build , so you can't really use those two as a way to output different URL schemes. I built a Jekyll plugin that does this with a Liquid Filter and one user defined variable in

How to pass {% captured %} variable from a view to the layout in Jekyll/Liquid?

五迷三道 提交于 2019-12-21 06:59:06
问题 I am trying to rebuild a blog in Jekyll and I have stubled upon a simple task. Provided I have the following set of templates: default.html: {{ head }} {{ content }} frontpage.html: --- layout: default --- {% capture head %} Frontpage {% end %} {{ content }} index.html: --- layout: frontpage --- Other stuff I was expecting that {% capture head %} would pass a variable to layout. But it seems only variables from the Front Matter are actually being passed as page.variable_name . Is there a way

Inserting my pdf in my blogs

青春壹個敷衍的年華 提交于 2019-12-21 05:26:08
问题 I have a posts page which stores every individual blog. And each blog has a pdf file. I can upload the pdf via the blog page but when I execute my code through the for-loop on posts - post.file_doucment_path it just shows the pdf file location. Do I need to add a seperate js pdf reader package to get it working? Cheers. 回答1: HTML5 <object> element can embed PDFs in a page without an external library. <object data="the.pdf" width="1000" height="1000" type='application/pdf'/> Just replace " the

Jekyll doesn't compile scss files with `jekyll serve`

风格不统一 提交于 2019-12-21 05:13:11
问题 I'm trying to create a website using Jekyll, and everything worked fine. Until I wanted to custom the design. I've updated my css/main.scss in order to include my custom theme in _sass/theme.scss : // Import partials from `sass_dir` (defaults to `_sass`) @import "base", "layout", "syntax-highlighting", "theme" ; I've also updated _config.yml , because jekyll serve -H 0.0.0.0 didn't compile my new sass file. I've added the following: sass: sass_dir: _sass The problem is jekyll serve doesn't

Can commits/pushes to github be automated?

こ雲淡風輕ζ 提交于 2019-12-21 05:10:11
问题 I've moved a site to a Jekyll / GitHub Pages setup and have an iOS-based markdown editor that syncs to dropbox. Currently I'm investigating ways to bridge the gap and have files created on the go automatically committed and pushed to the GitHub repo but unsure where to start. Is anything like this possible? (I am not experienced in using Automator on OSX but it seems like it might be an option, though I can't guarantee that a machine will be awake all the time) 回答1: Using cron should do the

How to include a HTML file inside a markdown file in jekyll?

☆樱花仙子☆ 提交于 2019-12-21 04:27:18
问题 I have a jekyll site with filestructure like so: ▾ _includes/ post-entry.html ▾ _posts/ 2012-11-25-first-post.markdown index.markdown In my index.markdown, I want to include a post-entry.html like this: {% for post in site.posts %} * {% include post-entry.html %} {% endfor %} But this appears as a HTML code snippet in the blog. How can i prevent the HTML from being protected? 回答1: You can use liquid tags in any markdown file so long as it has YAML header matter. For instance, check out the

Jekyll - declare image path in front matter as variable using {{ site.url }}

泄露秘密 提交于 2019-12-21 04:23:17
问题 When I use the {{ site.url }} tag for an image path inside a variable in the front matter, it doesn't get translated into HTML. The following works perfectly: --- layout: post title: chickpea img: <img class="caption__media" data-interchange="[../asset/img/chickpea-small.jpg (small)], [../asset/img/chickpea-medium.jpg, (medium)], [../asset/img/chickpea-large.jpg, (large)]"> --- This does NOT work: --- layout: post title: chickpea img: <img class="caption__media" data-interchange="[{{site.url}