Add more icons to code blocks with or without shortcode

This commit is contained in:
Ryan Watters 2017-03-02 02:09:00 -06:00
parent 9dc11d3b0c
commit fdcc05e781
9 changed files with 109 additions and 41 deletions

View File

@ -14,7 +14,7 @@ toc: true
Hugo is a general-purpose website framework. Technically speaking, Hugo is a [static site generator][]. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website's end users and an ideal writing experience for website authors.
Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including [Heroku][], [GoDaddy][], [DreamHost][], [GitHub Pages][], [Surge][], [Aerobatic][], [Firebase][], [Google Cloud Storage][], [Amazon S3][], [rackspace][], [Azure][], and [CloudFront][] and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.
Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including [Heroku][], [GoDaddy][], [DreamHost][], [GitHub Pages][], [Surge][], [Aerobatic][], [Firebase][], [Google Cloud Storage][], [Amazon S3][], [Rackspace][], [Azure][], and [CloudFront][] and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.
We think of Hugo as the ideal website creation tool. Hugo provides nearly instant build times and the ability to rebuild whenever a change is made, which is invaluable when you are designing websites and creating content.
@ -67,6 +67,6 @@ I wanted to develop a fast and full-featured website framework without any depen
[Middleman]: https://middlemanapp.com/
[Nanoc]: http://nanoc.ws/
[Nanoc]: https://nanoc.ws/
[rackspace]: https://www.rackspace.com/cloud/files
[Rackspace]: https://www.rackspace.com/cloud/files
[static site generator]: /about-hugo/benefits/
[Surge]: https://surge.sh

View File

@ -492,7 +492,7 @@ image = "good-to-great.jpg"
Now, we can start the server *without* the `buildDrafts` option.
```
```bash
hugo server --theme=hugo_theme_robust
```

View File

@ -1,5 +1,5 @@
<main id="homepage" class="main">
<div class="home-row hero row">
<div class="home-row hero">
<div class="homepage-icon animated">
{{ partial "svg-icons/newlogo.svg" . }}
</div>
@ -9,17 +9,25 @@
<a role="button" class="button xl" href="{{.Site.BaseURL}}getting-started/quick-start">Get started</a>
</div>
</div>
<div class="home-row">
<div class="half">
<div class="svgs-one animated">
{{partial "svg-icons/gopher-small.svg" .}} {{partial "svg-icons/md.svg" .}}
<div class="home-row terminal">
<div class="home-row-content">
<div class="half">
<div class="svgs-one animated">
{{partial "svg-icons/gopher-small.svg" .}} {{partial "svg-icons/md.svg" .}}
</div>
<div class="homepage-terminal">
$ brew update
<br> $ brew install hugo
</div>
<div class="after-terminal">
Here is some more content to get to fire on scroll.
</div>
</div>
<div class="homepage-terminal">
$ brew update
<br> $ brew install hugo
</div>
<div class="after-terminal">
Here is some more content to get to fire on scroll.
<div class="half">
<div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit dolorum iure et, esse commodi velit, ad corrupti harum repellat ratione aliquam explicabo consequatur qui fugit libero quos nisi quam similique!
</div>
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Placeat tempore incidunt, beatae nam quod repellat ullam culpa iure. Quidem neque corrupti a praesentium mollitia perferendis impedit quibusdam ipsum et officiis.</div>
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
<svg id="hugologo" width="100%" height="100%" viewBox="0 0 700 320" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<svg width="100%" height="100%" viewBox="0 0 700 320" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
<g transform="matrix(1.11154,0,0,1.62547,-29.7315,-55.1715)">
<g>
<path d="M119.631,38.891L203.822,75.478L203.822,190.045L119.631,225.859L35.578,190.045L35.578,75.478L119.631,38.891Z" style="fill:rgb(201,23,126);stroke:rgb(201,23,126);stroke-width:5.03px;"/>

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -7,7 +7,7 @@
font-weight: $code-font-base-weight;
position: relative;
overflow-y: visible;
z-index:1;
z-index: 1;
}
pre > code,
.code {
@ -55,16 +55,16 @@ code[class^="language-"] {
}
}
.copy-button + .code-copy-content {
code[class^="language-"] {
&:after {
display: none;
position: absolute;
top: -14px;
right: 4px;
}
}
}
// .copy-button + .code-copy-content {
// code[class^="language-"] {
// &:after {
// // display: none;
// position: absolute;
// top: -4px;
// right: 4px;
// }
// }
// }
code.language-html:after {
font-family: 'FontAwesome';
@ -91,6 +91,42 @@ code.language-scss:after {
content: '\e803';
}
code.language-bash:after,
code.language-sh:after {
font-family: 'fontello';
content: '\e804';
}
code.language-toml:after {
content: 'TOML';
font-size: .8em;
padding-right: .3em;
}
code.language-yaml:after,
code.language-yml:after {
content: 'TOML';
font-size: .8em;
padding-right: .3em;
}
code.language-md:after,
code.language-markdown:after {
font-family: 'fontello';
content: '\e80e';
}
.copy-button + .code-copy-content {
code[class^="language-"] {
&:after {
display:none;
position: absolute;
top: -8px;
right: 4px;
}
}
}
.filename {
font-family: $code-font-family;
color: lighten($base-font-color, 45%);

View File

@ -121,7 +121,7 @@ nav#TableOfContents {
}
> ul {
display: block;
display: none;
// display: none;
margin-top: 8px;
margin-bottom: 0px;
> li {
@ -151,9 +151,9 @@ nav#TableOfContents {
}
}
}
ul {
display: none;
}
// ul {
// display: none;
// }
}
}
}

View File

@ -57,18 +57,39 @@ main#homepage.main {
min-height: 100vh;
display: flex;
flex-wrap: wrap;
// flex-direction: column;
align-items: center;
&.hero {
margin-top: 50px;
min-height: auto;
flex-direction: column;
align-items: center;
}
&:nth-child(2) {
background-color: $hugo-gray-ultra-light;
}
}
.home-row-content {
display:flex;
max-width:$L * 1.2;
margin-left:auto;
margin-right:auto;
}
.half {
width: 100%;
display:flex;
flex-direction:column;
align-items:center;
margin-top:2em;
@include MQ(L) {
max-width: 45%;
}
@include MQ(XL) {
max-width:$L * .45;
}
}
.get-started {
.button.xl {
display: block;
@ -76,6 +97,10 @@ main#homepage.main {
font-size: 1.3em;
padding-right: 1em;
padding-left: 1em;
width: auto;
max-width: 12em;
margin-left: auto;
margin-right: auto;
// background-color: rgb(140,197,231);
}
margin-bottom:5em;
@ -149,14 +174,12 @@ main#homepage.main {
}
.svgs-one {
display:flex;
justify-content:space-around;
max-width:320px;
margin-top:2em;
opacity:0;
display: flex;
justify-content: space-around;
opacity: 0;
svg {
max-width:45%;
max-width:140px;
max-width: 45%;
max-width: 140px;
// min-width: 150px;
&#markdown {
margin-top: 30px;

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
//IIFE to remove all third-level li's from TOC so as not to negatively affect scrollspy
(function() {
// let levelFours = document.querySelectorAll('#TableOfContents > ul > li > ul > li ul');
let levelFours = document.querySelectorAll('#TableOfContents > ul > li > ul > li > ul > li > ul');
if (levelFours) {
for (var i = 0; i < levelFours.length; i++) {