Skip to content
Browse files

Template adjustments for iframe nesting

  • Loading branch information...
1 parent 1918481 commit 5b3d7c85683fea1be1cd6d06c6644798dee68615 @hallaathrad hallaathrad committed
Showing with 30 additions and 107 deletions.
  1. +7 −0 convert_files.js
  2. +10 −5 css/gatsby.css
  3. +3 −0 install.sh
  4. +0 −3 local.sh
  5. +2 −1 print.sh
  6. +4 −81 templates/_template.jsx
  7. +2 −15 templates/lang/_template.jsx
  8. +1 −1 wiki-gh-pages
  9. +1 −1 wiki-master
View
7 convert_files.js
@@ -43,10 +43,17 @@ langFolders.filter(langFolder => {
// Update Links
data = data.replace(incomingLink, outgoingLink)
.replace(/\.\/images/gi, '../images'); // Update image links to be relative
+
+ // Dirty hack to remove the first line of home
+ if(fileObj.isHome) {
+ data = data.replace(/^#[^\n]+\n/,'');
+ }
+
var newData = new Buffer(data);
// Make the "Home" file display at the top
var order = (fileObj.isHome) ? 0 : 5;
+
// Create Header
var header = `---\ntitle: ${fileObj.title}\norder: ${order}\n---\n`;
View
15 css/gatsby.css
@@ -1,6 +1,9 @@
-.container {
+body,html {
+ overflow:hidden;
+}
+.wiki-container {
max-width:960px;
- padding:90px 30px 0;
+ padding:80px 30px 0;
margin:0 auto;
position:relative;
}
@@ -17,7 +20,6 @@ a:hover {
width:100%;
height:80px;
background:#fff;
- margin-left:-30px;
}
.wiki-header a {
color:#fff;
@@ -32,19 +34,21 @@ a:hover {
.wiki-header span {
position:absolute;
}
+.article-container {
+}
.articleContent {
width:95%;
margin:40px auto 0;
}
.wikiSelector {
position:fixed;
- top:90px;
+ top:50px;
}
.wikiSelector select {
width:95%;
}
.wikiAside {
- width: 220px;
+ width: 250px;
border-left: 1px solid lightgrey;
float:right;
padding-left:20px;
@@ -58,6 +62,7 @@ a:hover {
margin-left: 0;
height:82vh;
overflow-y: scroll;
+ text-transform: capitalize;
}
@media (max-width:700px) {
View
3 install.sh
@@ -3,12 +3,15 @@
echo "Initializing Submodules . . ."
git submodule init
git submodule update
+echo "modules ready"
echo "Selecting branches"
cd wiki-master
git checkout master
+echo "master checked out"
cd ../wiki-gh-pages
git checkout gh-pages
+echo "gh-pages checked out"
cd ..
View
3 local.sh
@@ -32,9 +32,6 @@ gatsby build --prefix-links
cp -r wiki-master/images/* wiki-gh-pages/images/
cp -r public/* wiki-gh-pages/
cp css/* wiki-gh-pages/css/
-cp public/bundle.js wiki-gh-pages/
-cp public/index.html wiki-gh-pages/
-cp public/bundle.js.map wiki-gh-pages/
# Get to work, baby!
gatsby develop
View
3 print.sh
@@ -1,2 +1,3 @@
#!/bin/bash
-cp ./pages/_template.jsx ./templates/.
+cp ./pages/_template.jsx ./templates/.
+cp ./pages/en/_template.jsx ./templates/lang/.
View
85 templates/_template.jsx
@@ -18,89 +18,12 @@ const { rhythm, fontSizeToPx } = typography;
module.exports = React.createClass({
mixins: [State, Navigation],
-
- getInitialState: function() {
- return {
- filterText: ''
- };
- },
-
- handleTopicChange: function(e) {
- return this.transitionTo(e.target.value);
- },
-
- handleSearchChange: function(e) {
- this.setState({
- filterText: this.refs.filterTextInput.value
- });
- },
-
render: function() {
- var childPages, docOptions, docPages;
- childPages = templateChildrenPages(__filename, this.props.state).map(function(child) {
- return {
- title: child.data.title,
- order: child.data.order,
- path: child.path
- };
- });
- childPages = sortBy(childPages, function(child) {
- return child.order;
- });
- docOptions = childPages.map(function(child) {
- return React.createElement("option", {
- "key": child.path,
- "value": child.path
- }, child.title);
- });
- docPages = childPages
-
- .filter(function(child) {
- if(this.state.filterText.length > 0) {
- let regex = new RegExp(this.state.filterText,'i');
- return regex.test(child.title);
- } else {
- return true;
- }
- },this)
- .map((function(_this) {
-
- return function(child) {
- var isActive;
- isActive = _this.isActive(link(child.path));
- return (
- <li
- key={child.path}
- style={{
- marginBottom: rhythm(1/2)
- }}
- >
- <Link
- to={link(child.path)}
- >
- {isActive ? <strong>{child.title}</strong> : child.title }
- </Link>
- </li>
- )
- };
- })(this));
-
return (
- <div className='container'>
- <div className='wiki-header'>
- <a href='http://www.freecodecamp.com'
- >
- <img
- src="http://i.imgur.com/L5o713v.png"
- />
- <span>
- Return to the main site
- </span>
- </a>
- </div>
- <div className='articleContent'>
- <RouteHandler typography={typography} {...this.props}/>
- </div>
+ <div className='wiki-container'>
+ <div className='article-container'>
+ <RouteHandler typography={typography} {...this.props}/>
+ </div>
</div>
);
}
View
17 templates/lang/_template.jsx
@@ -37,8 +37,7 @@ module.exports = React.createClass({
render: function() {
var childPages, docOptions, docPages;
- var langRegex = new RegExp( '^/' + __filename.slice(0,2));
- console.log(langRegex.toString());
+ var langRegex = new RegExp( '^/' + __filename.slice(0,2))
childPages = templateChildrenPages(__filename, this.props.state).map(function(child) {
return {
title: child.data.title,
@@ -58,7 +57,6 @@ module.exports = React.createClass({
}, child.title);
});
docPages = childPages
-
.filter(function(child) {
if(this.state.filterText.length > 0) {
let regex = new RegExp(this.state.filterText,'i');
@@ -90,18 +88,7 @@ module.exports = React.createClass({
})(this));
return (
- <div className='container'>
- <div className='wiki-header'>
- <a href='http://www.freecodecamp.com'
- >
- <img
- src="http://i.imgur.com/L5o713v.png"
- />
- <span>
- Return to the main site
- </span>
- </a>
- </div>
+ <div>
<Breakpoint minWidth={700}>
<div className="wikiAside">
<div className='searchBar'>
2 wiki-gh-pages
@@ -1 +1 @@
-Subproject commit 1745e53615ed1ff86037aeca94d37e74701cf4d0
+Subproject commit 4798402429d96d7248ad39c49b6c17a8f5aeac16
2 wiki-master
@@ -1 +1 @@
-Subproject commit e9fd4a9e0e073bd32f2fac883ae31d3382cf0a15
+Subproject commit 85c028b48247cf791201b955dc357a91c2f64758

0 comments on commit 5b3d7c8

Please sign in to comment.
Something went wrong with that request. Please try again.