Browse Source

Many layout fixes

James Peret 3 years ago
parent
commit
81c08622c9

+ 39 - 31
readme.md

@@ -18,7 +18,7 @@ Based on [Hexo](http://hexo.io) for building the static website.
   
   - [x] **About page content**
   
-  - [ ] **Add nav links to home page header**
+  - [x] **Add nav links to home page header**
   
   - [ ] Filter projects using URL parameters
   
@@ -50,7 +50,7 @@ Based on [Hexo](http://hexo.io) for building the static website.
   
   - [x] **Screenshot thumbnail resizing**
   
-  - [ ] **Project downloadable files**
+  - [x] **Project downloadable files**
   
   - [x] redirect to jamesperet.com
   
@@ -90,7 +90,7 @@ Based on [Hexo](http://hexo.io) for building the static website.
   
   - [x] Fix star-fighter project data
   
-  - [ ] Upload Aurora do Pilantra files to S3
+  - [x] Upload Aurora do Pilantra files to S3
   
   - [ ] Back2Black description
   
@@ -105,37 +105,45 @@ Based on [Hexo](http://hexo.io) for building the static website.
   - [ ] O violador description
   
   - [ ] Istar Uours description
-
-- [ ] Rebel Elite hero image
-
-- [ ] Rebel Elite screenshots
-
-- [ ] BattleScape hero image
-
-- [ ] BattleScape screenshots
-
-- [ ] Add project vertentes.tv
-
-- [ ] Add project whois-server
-
-- [ ] Add project auto-video
-
-- [ ] Add project sozinho
-
-- [ ] Add project o-outro
-
-- [ ] Add project alo
-
-- [ ] Fix solar-wave project data
-
-- [ ] Add project Julgamento Absurdista
-
-- [ ] Add project Anarco-experimentalismo
-
-- [ ] Fix Vinheta Lav video embed
+  
+  - [x] Rebel Elite hero image
+  
+  - [x] Rebel Elite screenshots
+  
+  - [x] Rebel Elite mac app
+  
+  - [ ] BattleScape hero image
+  
+  - [ ] BattleScape screenshots
+  
+  - [ ] Add project vertentes.tv
+  
+  - [ ] Add project whois-server
+  
+  - [ ] Add project auto-video
+  
+  - [ ] Add project sozinho
+  
+  - [ ] Add project o-outro
+  
+  - [ ] Add project alo
+  
+  - [ ] Fix solar-wave project data
+  
+  - [ ] Add project Julgamento Absurdista
+  
+  - [ ] Add project Anarco-experimentalismo
+  
+  - [x] Fix Vinheta Lav video embed
+  
+  - [ ] Add project Undead Earth
+  
+  - [x] Fix project CUB
 
 ### Extras
 
+- [ ] Spell checker
+
 - [ ] Couch mode view
 
 - [ ] Timeline view

+ 2 - 0
source/robots.txt

@@ -0,0 +1,2 @@
+User-agent: *
+Disallow:

+ 46 - 0
themes/james-theme/layout/_partial/head.ejs

@@ -2,6 +2,51 @@
   <meta charset="utf-8">
 
   <title><% if (page.title){ %><%= page.title %> | <% } %><%= config.title %></title>
+  <% var description, title, twitter_description, image %>
+  <% if(page.canonical_path == 'index.html') { %>
+    <% title = "James Peret Website" %>
+    <% description = "Website of James Peret, a designer, programmer and filmmaker from São Paulo, Brazil." %>
+    <% twitter_description = description %>
+  <% } else if(page.canonical_path == 'projects/index.html') { %>
+    <% title = "James Peret Portfolio" %>
+    <% description = "Portfolio of James Peret. Checkout his games, videos and software." %>
+    <% twitter_description = description %>
+  <% } else if(page.canonical_path == 'blog/index.html') { %>
+    <% title = "J1X Blog" %>
+    <% description = "J1X Blog. Technical writings by James Peret." %>
+    <% twitter_description = "Technical writings by James Peret." %>
+  <% } else if(page.canonical_path == 'about/index.html') { %>
+    <% title = "About James Peret." %>
+    <% description = "Read more about James Peret." %>
+    <% twitter_description = description %>
+  <% } else if(page.layout == 'project') { %>
+    <% title = page.title %>
+    <% description = page.description %>
+    <% twitter_description = description %>
+    <% image = `http://jamesperet.com/projects/${page.folder}/${page.cover_image}` %>
+  <% } else if(page.layout == 'post') { %>
+    <% title = page.title %>
+    <% description = page.excerpt %>
+    <% twitter_description = description %>
+    <% image = `http://jamesperet.com/blog/${page.slug}/${page.cover_image}` %>
+  <% } %>
+
+  <meta name="description" content="<%= description %>">
+  <meta name="twitter:card" content="summary" />
+  <meta name="twitter:title" content="<%= title %>" />
+  <meta name="twitter:description" content="<%= description %>" />
+  <% if(image != undefined) { %>
+    <meta name="twitter:image" content="<%= image %>" />
+    <meta property="og:image"  content="https://example.com/image.png" />
+  <% } %>
+  <meta name="twitter:creator" content="@jamesperet" />
+  <meta name="twitter:site" content="@jamesperet" />
+  <meta property="og:title" content="<%= title %>" />
+  <meta property="og:description" content="<%= description %>" />
+  <meta property="og:url" content="http://jamesperet.com/<%= page.canonical_path %>" />
+  <meta property="og:type" content="article" />
+  <meta property="og:site_name" content="James Peret Website" />
+
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
   <link rel="icon" type="image/png" href="http://jamesperet.com/favicon-16x16.png" sizes="16x16">
   <link rel="icon" type="image/png" href="http://jamesperet.com/favicon-32x32.png" sizes="32x32">
@@ -9,4 +54,5 @@
   <link rel="icon" type="image/png" href="http://jamesperet.com/favicon-128.png" sizes="128x128">
   <link rel="icon" type="image/png" href="http://jamesperet.com/favicon-196x196.png" sizes="196x196">
   <%- css('css/style') %>
+
 </head>

+ 1 - 1
themes/james-theme/layout/_partial/project-dropdown.ejs

@@ -6,7 +6,7 @@
             </button>
             <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
                 <% link.links.forEach(sublink => { %>
-                    <a class="dropdown-item <%- link.disabled %>" href="<%= sublink.url %>"><%= sublink.name %></a>      
+                    <a class="dropdown-item <%- link.disabled %>" href="<%= get_s3_link(sublink, project) %>"><%= sublink.name %></a>      
                 <% }); %>
             </div>
         </div> 

+ 16 - 7
themes/james-theme/layout/index.ejs

@@ -5,13 +5,22 @@
     <div id="stars-2"></div>
     <div id="stars-3"></div>
     <div class="center-div" id="app">
-        <h1>
-            <a href="jamesperet.com">
-                <img class="text-logo" alt="James Peret" src="images/jamesperet-logo-white.png">
-            </a>
-        </h1>
         <div class="container bottom-spacer">
-            <div class="row bottom-spacer-lg">
+            <div class="row justify-content-md-center">
+                <div class="col12">
+                    <h1><img class="text-logo" alt="James Peret" src="images/jamesperet-logo-white.png"></h1>
+                </div>
+            </div>
+            <div class="row justify-content-md-center bottom-spacer-md">
+                <div class="col4">
+                    <ul class="nav">
+                        <li class="nav-item"><a class="nav-link" href="/projects">Projects</a></li>
+                        <li class="nav-item"><a class="nav-link" href="/blog">Blog</a></li>
+                        <li class="nav-item"><a class="nav-link" href="/about">About</a></li>
+                    </ul>
+                </div>
+            </div>
+            <div class="row bottom-spacer-md">
                 <div class="col-3">
                     <img class="img-fluid" src="images/james-peret-drawing.png">
                 </div>
@@ -66,7 +75,7 @@
                     <%- partial('_partial/content-thumbnail', {post: post, show_title: false, size: 12}) %>
                 <% } else if(games.length == 2) { %>
                     <%- partial('_partial/content-thumbnail', {post: post, show_title: false, size: 6}) %>
-                <% } else if(games.lenth == 3) { %>
+                <% } else if(games.length == 3) { %>
                     <%- partial('_partial/content-thumbnail', {post: post, show_title: false, size: 4}) %>
                 <% } else { %>
                     <%- partial('_partial/content-thumbnail', {post: post, show_title: false, size: 3}) %>

+ 1 - 1
themes/james-theme/layout/layout.ejs

@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html class="h-100">
-  <%- partial('_partial/head') %>
+  <%- partial('_partial/head', { data: page, page: page }) %>
   <body class="d-flex flex-column h-100">
     <% if(!is_home()) { %>
       <%- partial('_partial/navbar') %>

+ 1 - 1
themes/james-theme/layout/project.ejs

@@ -19,7 +19,7 @@
       <% } %>
     </div>
     <div class="col-3" style="text-align: right; margin-top: 5px;">
-      <%- partial('_partial/project-dropdown', { links : page.links }) %>
+      <%- partial('_partial/project-dropdown', { links : page.links, project: page }) %>
     </div>
   </div>
   <div class="row">

+ 12 - 0
themes/james-theme/scripts/s3-files.js

@@ -0,0 +1,12 @@
+hexo.extend.helper.register('get_s3_link', function(link, project){
+    if(project.files == undefined) return link.url;
+    for (let i = 0; i < project.files.length; i++) {
+        const file = project.files[i];
+        if(file.title == link.file){
+            if(file.s3 != undefined){
+                return file.s3.url;
+            }
+        }
+    }
+    return link.url;
+});

+ 8 - 1
themes/james-theme/source/css/style.styl

@@ -15,6 +15,9 @@ html {
   margin-bottom: 80px;
 }
 
+.background-haze .nav-link { color: white; }
+.background-haze .nav-link:hover { color: white; text-decoration: underline;}
+
 body {
   font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
   margin: 0px;
@@ -133,7 +136,7 @@ body {
 
 .text-logo {
 	    padding-top: 120px;
-      padding-bottom: 120px;
+      padding-bottom: 30px;
 	    width: 700px;
 }
 
@@ -141,6 +144,10 @@ body {
   margin-bottom: 30px;  
 }
 
+.bottom-spacer-md {
+  margin-bottom: 60px;  
+}
+
 .bottom-spacer-lg {
   margin-bottom: 120px;  
 }