css: Work on new style guidelines. Created layouts and author mechanism

git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@36 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
Claudio Maggioni 2018-11-05 20:03:04 +00:00
parent 595921e4b8
commit 8b95e4141f
17 changed files with 193 additions and 199 deletions

30
bonus1/Cargo.lock generated
View File

@ -40,6 +40,7 @@ dependencies = [
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"reqwest 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -666,6 +667,14 @@ name = "safemem"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "same-file"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "schannel"
version = "0.1.14"
@ -1036,6 +1045,16 @@ name = "void"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "walkdir"
version = "2.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "want"
version = "0.0.6"
@ -1070,6 +1089,14 @@ name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-util"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
@ -1162,6 +1189,7 @@ dependencies = [
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
"checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7"
"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
"checksum schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1a231dc10abf6749cfa5d7767f25888d484201accbd919b66ab5413c502d56"
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
"checksum security-framework 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "697d3f3c23a618272ead9e1fb259c1411102b31c6af8b93f1d64cca9c3b0e8e0"
@ -1204,10 +1232,12 @@ dependencies = [
"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d"
"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum walkdir 2.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0ffb549f212c31e19f3667c55a7f515b983a84aef10fd0a4d1f9c125425115f3"
"checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "afc5508759c5bf4285e61feb862b6083c8480aec864fa17a81fdec6f69b461ab"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"

View File

@ -7,3 +7,4 @@ authors = ["Claudio Maggioni <claudio@maggioni.xyz>"]
reqwest = "0.9.4"
regex = "1"
lazy_static = "1.1.0"
walkdir = "2"

View File

@ -3,16 +3,19 @@
/// *Authors:* Claudio Maggioni, Joey Bevilacqua
///
/// Group 1
extern crate reqwest;
extern crate regex;
#[macro_use]
extern crate lazy_static;
extern crate walkdir;
use std::fs::File;
use std::io;
use std::env;
use std::process;
use std::io::prelude::*;
use regex::Regex;
use walkdir::WalkDir;
fn read_file(path: &str) -> io::Result<String> {
let mut file = File::open(path)?;
@ -53,5 +56,35 @@ fn test_is_url_working() {
}
fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 2 {
println!("Please provide directory with HTML files as 1st argument.");
process::exit(127);
} else {
let dir = &args[1];
for entry in WalkDir::new(dir) {
match entry {
Ok(en) => {
let md: std::fs::Metadata = en.metadata().unwrap();
if md.is_dir() {
continue;
}
lazy_static! {
static ref RE: Regex = Regex::new(".html$").unwrap();
}
if RE.is_match(en.file_name().to_str().unwrap()) {
println!("{}", en.path().display());
}
}
Err(e) => {
println!("{}", e);
process::exit(2);
}
}
}
}
}

View File

@ -0,0 +1,4 @@
---
name: Claudio Maggioni
position: Team Leader
---

View File

@ -0,0 +1,4 @@
---
name: Joey Bevilacqua
position: SVN Leader
---

View File

@ -10,3 +10,5 @@ title: Group 1 project
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site
future: true
collections:
authors:

View File

@ -1,13 +1,10 @@
<footer>
<div class="footer container">
<section class="author">
<h3>INFO</h3>
<strong>Author:</strong> {{ page.author }}<br>
<a href="/credits.html">Credits</a>
</section>
<section>
<h3>Other section</h3>
<a href="http://www.malusa.it">Other link</a>
<h4>Page by:</h4>
{% assign author = site.authors | where: 'name', page.author | first %}
<h2 class="{% if author %}margin{% endif %}">{{ page.author }}</h2>
{% if author %}<h3>{{ author.position }}</h3>{% endif %}
</section>
</div>
<div class="copyright">

View File

@ -1,43 +1,11 @@
<div class="menuDesktop">
<span class="boxTitle">
<h1 class="title">THE SHELL</h1>
</span>
<span class="boxItem">
<a href="">FILE SYSTEM</a>
<a href="">BASIC</a>
<a href="">INTERMEDIATE</a>
<a href="">ADVANCED</a>
<a href="">SCRIPTING</a>
</span>
</div>
<div class="menuDesktop">
<span class="boxTitle">
<a href="/index.html"><img src="/assets/style/logo_white.png" height="50"></a>
</span>
<span class="boxItem">
<a href="">Learn</a>
<code>|</code>
<a href="">About</a>
</span>
</div>
<span id="menuTriggerMobile" onclick="triggerMenu(this)">
<div class="strip1"></div>
<div class="strip2"></div>
<div class="strip3"></div>
</span>
<div id="menuMobile" style="margin-left:-100%;">
<a class="menuItem" href="">FILE SYSTEM</a>
<a class="menuItem" href="">BASIC</a>
<a class="menuItem" href="">INTERMEDIATE</a>
<a class="menuItem" href="">ADVANCED</a>
<a class="menuItem" href="">SCRIPTING</a>
</div>
<!-- <nav class="navbar">
<div class="container">
<ul class="navbar-list">
<li class="navbar-item">
<a href="{{ "/" | prepend: site.baseurl | prepend: site.url }}">home</a>
</li>
{% for my_page in site.pages %}
{% if my_page.title %}
<li class="navbar-item">
<a href="{{ my_page.url | prepend: site.baseurl | prepend: site.url }}">
{{ my_page.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</nav>-->

14
site/_layouts/topic.html Normal file
View File

@ -0,0 +1,14 @@
---
layout: main
---
<article class="post">
<header class="post-header">
<h2 class="post-title">{{ page.title }}</h2>
</header>
<div class="post-content">
{{ content }}
</div>
</article>

View File

@ -4,12 +4,10 @@
*/
footer {
background-color: #333;
background-color: #646464;
color: white;
.footer.container {
display: flex;
flex-direction: row;
padding: 1em;
}
@ -17,14 +15,13 @@ footer {
flex-grow: 1;
padding: .5rem;
h3 {
text-transform: uppercase;
h2.margin, h4 {
padding-bottom: .5em;
}
}
.copyright {
background: #111;
background: #515151;
width: 100%;
.container {
@ -32,8 +29,4 @@ footer {
padding-bottom: 1em;
}
}
section.author {
width: 30%;
}
}

View File

@ -10,6 +10,9 @@ body {
display: flex;
flex-direction: column;
height: 100vh;
background: #333333;
color: white;
min-width: 475px;
}
main {

View File

@ -7,117 +7,38 @@ header {
span {
display:inline-block;
}
/*------- MENU ------*/
#menuMobile{
display:none;
}
#menuTrigger{
display:none;
}
.menuDesktop{
background-color: #333;
}
.boxTitle{
background: #000;
width: 30%;
}
.boxItem{
width: 69%;
}
.title {
color: green;
padding: 20px 0px;
}
.boxItem a{
font-family: "Lato", sans-serif;
display: inline-block;
color: #6a6;
font-weight: bold;
text-decoration: none;
font-size: 2.3vh;
padding: 0 5px;
}
/*header .menu.desktop {
background: #333;
display: flex;
justify-content: center;
align-items: center;
a {
text-decoration: none;
text-transform: uppercase;
font-weight: bold;
line-height: 100%;
font-size: 1.15em;
padding: 0 1em;
}
a:hover {
color: #8e8;
}
a:visited {
color: #6a6;
}
}*/
@media screen and (max-width: 800px) {
.menuDesktop {
display: none;
}
#menuTriggerMobile{
cursor:pointer;
padding: 10px 20px;
transition:1000ms;
float: left;
}
#menuMobile{
z-index:1;
display:block;
height:100%;
position:fixed;
transition:1000ms;
background-color:#000;
text-align:center;
}
.strip1, .strip2, .strip3 {
width:35px;
height:5px;
background-color:#4d0000;
transition:400ms;
margin:6px 0;
}
.cross .strip1 {
-webkit-transform:rotate(-45deg) translate(-9px, 6px);
transform:rotate(-45deg) translate(-9px, 6px);
}
.cross .strip2 {
opacity:0;
}
.cross .strip3 {
-webkit-transform:rotate(45deg) translate(-8px, -8px);
transform:rotate(45deg) translate(-8px, -8px);
}
.menuItem{
padding:40px 20px;
width:calc(100% - 40px);
transition:500ms;
font-size:4.5vh;
}
.menuDesktop {
background-color: #131313;
position: relative;
text-align: justify;
}
.boxTitle {
padding: .5em;
}
.title {
color: green;
padding: 20px 0px;
}
.boxItem {
position: absolute;
right: 1em;
top: 0;
height: calc(50px + 1em);
display: inline-table;
}
.boxItem a, .boxItem code {
display: table-cell;
vertical-align: middle;
color: #6a6;
font-weight: bold;
text-decoration: none;
font-size: 2.3vh;
padding: 0 5px;
}

View File

@ -2,10 +2,11 @@
* Syntax highlighting styles
*/
.highlight {
background: #fff;
background: #bdbdbd;
color: #212121;
.highlighter-rouge & {
background: #eef;
background: #bdbdbd;
}
.c { color: #998; font-style: italic } // Comment

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,28 +1,7 @@
---
layout: main
author: Claudio Maggioni
author: A bunch of people
title: Home page
---
<section>
<h1>ls</h1>
<p>The ls command is used to list files</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Hello</li>
</ul>
{% highlight ruby linenos %}
def show
puts "Outputting a very lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong line"
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
{% endhighlight %}
</section>
<a href="/pages/cmd/basic/ls">Example LS command</a><br>
<a href="/pages/cmd/basic/cd">Example CD comment</a>

View File

@ -0,0 +1,22 @@
---
layout: page
author: Joey Bevilacqua
title: CD
---
<p>The <code>cd</code> command is used to change directories</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Hello</li>
</ul>
{% highlight ruby linenos %}
def show
puts "Outputting a very lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong line"
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
{% endhighlight %}

View File

@ -0,0 +1,22 @@
---
layout: page
author: Claudio Maggioni
title: LS
---
<p>The ls command is used to list files</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Hello</li>
</ul>
{% highlight ruby linenos %}
def show
puts "Outputting a very lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong line"
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
{% endhighlight %}