在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:clayh53/tufte-jekyll开源软件地址:https://github.com/clayh53/tufte-jekyll开源编程语言:SCSS 70.1%开源软件介绍:tufte-jekyll themeThe Tufte-Jekyll blog theme is based on the github repository by Edward Tufte here, which was orginally created by Dave Leipmann, but is now labeled under Edward Tufte's moniker. I borrowed freely from the Tufte-CSS repo and have transformed many of the typographic and page-structural features into a set of custom Liquid tags that make creating content using this style much easier than writing straight HTML. Essentially, if you know markdown, and mix in a few custom Liquid tags, you can be creating a website with this document style in short order. Please be aware that the feature parity between the tufte-css repository and this project is not perfect. It is very close, but this Jekyll theme has additional CSS to scratch some of my own itches. One example is that the sidenote's typography is vertically spaced in my CSS so they are on the same baseline grid as the body text and it doesn't hurt my eyes when I look at them. Another example is the optional use of color to style links. The current tufte.css repo doesn't allow that, but my opinion is that hey, this is the web. It shouldn't have to ape the way a book looks exactly. I attempt to stay true to the overall sensibility of the tufte.css repo, but I am not going to sacrifice anything that I think reduces the usability or esthetics of this theme in the service of exact feature parity. Just as I have 'forked' the tufte.css, you are more than welcome to modify this theme to suit your own tastes and specific needs. DemoA sample site with self-documenting content is available here on github pages. InstallationI'm not going to go into great detail here. I am just going to assume that anyone interested in either Jekyll, Edward Tufte's work or Github has some basic skills. I created this with Ruby 2.2.0 and Jekyll 2.5.3. There is absolutely nothing exotic going on here, so you can probably make any recent version of Jekyll work with this setup. So copy, pull, download a zipfile or whatever and fire it up.
And then point your browser at localhost:4000/tufte-jekyll You can also use ConfigurationJekyll site building optionsI have created a very simple site options file in the
Removing either 'true' value will prevent the jekyll site building process from adding links to either the Mathjax library or the Google Fonts Lato font as a fallback for the Gill Sans. Set these values to blank if you want to really streamline your page loading time. SASSI am using Sass to create the css file used by this theme. If you would like to change things like fonts, text colors, background colors and so forth, edit the Social iconsYou can edit the Silly-ass badge in the upper leftIn the Some things about the thingsI needed to create several custom Liquid tags to wrap content in the right kind of tags. You will create your posts in the normal way in the Note that these tags have been altered from Version 1 of this theme to accommodate some responsive features, namely the ability to reveal hidden sidenotes, margin notes and margin figures by tapping either a superscript or a symbol on small screens. This requires you to add a parameter to the tag that is a unique ID for each tag instance on the page. What the id is called is not important, but it is important that it be unique for each individual element on the page. I would recommend in the interest of sanity to give names that are descriptive, like Notes about quotes in Liquid tagsThe custom Liquid tags are designed to simplify writing content and displaying it with the tufte-css look. Here are a few notes on using quotes inside the tags.
The demo site's Edge Cases entry has an example toward the bottom illustrating HTML inside of a tag parameter. EpigraphThis tag will render its three components into a standalone epigraph. This can be used as an introduction to a page or to a section within a page. As with most things Markdown, surround the epigraph with a blank line above and below it.
New thoughtThis tag will render its contents in small caps. Useful at the beginning of new sections:
SidenoteThis tag inserts a sidenote in the content, which is like a footnote, only its in the spacious right-hand column. It is automatically numbered, starting over on each page. Just put it in the content like you would insert a footnote like so:
And it will add the html spans and superscripts. On smaller screens, tapping on the number will reveal the sidenote! The Margin noteThis tag is essentially the same as a sidenote, but heh, no number. Like this:
On smaller screens, tapping on the ⊕ symbol will open up the margin note. The Full width imageThis tag inserts an image that spans both the main content column and the side column:
or
Note the absence of a leading slash in the image url when using relative file paths. (This is incorrect: Also note that fullwidth images need to be included on their own line in order for the captions to work correctly. Main column imageThis tag inserts an image that is confined to the main content column:
or
No need for an ID in this tag because it doesn't have any doohickies that open and close on narrow screens. Again note the absence of the leading slash in the image url when using relative file paths. (This is incorrect: And just like fullwidth images, main column images need to be included on their own line in order for the captions to work correctly. Margin figureThis tag inserts and image in the side column area. Note that an id needs to be specified:
or
This needs an ID parameter so that it can be clicked and opened on small screens. Again note the absence of the leading slash in the image url when using relative file paths. (This is incorrect: The MathjaxFor those wanting to use this Jekyll theme for academic writing, the new Kramdown Markdown engine will accurately parse MathJax expressions as long as they are enclosed in a pair of double dollar signs like this: As a side note - if you do not need the math ability, navigate to the Setting your baseurl correctlyIn the Set this to your own project name if you're going to serve your site from Github Pages. Be sure to include the leading slash, and no trailing slash. For example: For a full explanation of setting your baseurl to work with Github Pages, see the Project Page URL Structure section of the Jekyll documentation. To serve from anywhere else besides Github Pages, use a blank baseurl in your
This is RakefileI have added a boilerplate Rakefile directly from the jekyll-rake-boilerplate repo. This saves you a small amount of time by prepending the date on a post name and populated the bare minimum of YAML front matter in the file. Please visit the link to the repo to find out how it runs. One thing to note is that there should be no space between the task and the opening bracket of your file name. There is another rakefile (UploadtoGithub.Rakefile) included that only has one task in it - an automated upload to a Github Pages location of the site. This is necessary because of the plugins used by this theme. It does scary stuff like move your |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论