GithubHelp home page GithubHelp logo

nasapress's Introduction

NASAPress (a WordPress Theme)

screen shot 2018-06-15 at 12 31 39 pm

Sites using NASAPress

If you'd like your site to be added to this list please create an issue with your website name and URL.

Features

Required plugins

Recommended plugins

Designed for use with these services

Requirements

Make sure all dependencies have been installed before moving on:

Theme installation

Clone this repo into your WordPress themes directory.

Install Composer dependencies:

# @ app/themes/nasapress or wp-content/themes/nasapress
$ composer install

Run yarn from the theme directory to install dependencies. If you won't be making changes to the theme's static assets (css, javascript, images) then run yarn install --production.

Update resources/assets/config.json settings:

  • devUrl should reflect your local development hostname
  • publicPath should reflect your WordPress folder structure (/wp-content/themes/nasapress for non-Bedrock installs)

Theme setup

Search the theme folder for todo-config. These comments mark the locations where you'll likely need to make customizations for your site.

Add top navigation

Create a menu and assign it to the 'Primary Navigation' location.

Enable breadcrumbs

Install and activate the Yoast SEO plugin. Follow steps 1-5 in this guide to enable yoast breadcrumbs.

Enable related pages

If you want to show related pages at the bottom of pages install and activate the YARPP plugin. On the plugin settings, you might see a message about 'consider titles' and 'consider bodies' being disabled due to InnoDB... If you are using MySQL 5.6 or greater, expand the message and click the 'Create FULLTEXT indices' button to enable them.

Under display options, select 'Pages', then click the Custom button and make sure 'You Might Also Like' is selected as the template file.

Add NASA Web Design Standards styles to Visual Editor

todo

Add site feedback form

todo

Using the theme

Page templates

Home page

Although not technically a template the theme expects a static front page and styles it differently than the others. Use the following as a starting point for this page.

<div class="usa-overlay"></div>

<section class="usa-hero">
  <div class="usa-grid">
    <div class="usa-width-one-half">
      <h1>Shaping the world of tomorrow</h1>
    </div>
  </div>
  <div class="usa-grid">
    <div class="usa-width-one-half">
      <p class="usa-font-lead">By developing technologies that will enable further exploration of the universe and revolutionize air travel</p>
    </div>
  </div>
  <div class="usa-grid">
    <div class="usa-width-two-thirds">
      <div class="video-container">
        https://www.youtube.com/watch?v=5VHPanW6F4E
      </div>
    </div>
  </div>
</section>

Landing Page

The landing page template features a large hero image with leading paragraph followed by text. Make sure your featured image is large enough to not pixellate too much at larger screen sizes.

Default template

The default template has no top hero section.

On this page navigation

The default and landing page templates automatically convert h2, h3, and h4 tags into left 'in page' navigation. For shorter pages, this may not be desired, and can be turned off in the "On this page" settings on the edit page screen. In this section, you can also change which heading tags to convert to navigation.

Setting NASA Official

A NASA Official can be added or changed on the edit page category screen. You can select from any users of your WordPress site.

Theme structure

themes/your-theme-name/   # → Root of your Sage based theme
├── app/                  # → Theme PHP
│   ├── lib/App/          # → NASAPress functions
│   ├── lib/Sage/         # → Blade implementation, asset manifest
│   ├── admin.php         # → Theme customizer setup
│   ├── filters.php       # → Theme filters
│   ├── helpers.php       # → Helper functions
│   └── setup.php         # → Theme setup
├── composer.json         # → Autoloading for `app/` files
├── composer.lock         # → Composer lock file (never edit)
├── dist/                 # → Built theme assets (never edit)
├── node_modules/         # → Node.js packages (never edit)
├── package.json          # → Node.js dependencies and scripts
├── resources/            # → Theme assets and templates
│   ├── assets/           # → Front-end assets
│   │   ├── config.json   # → Settings for compiled assets
│   │   ├── build/        # → Webpack and ESLint config
│   │   ├── fonts/        # → Theme fonts
│   │   ├── images/       # → Theme images
│   │   ├── scripts/      # → Theme JS
│   │   └── styles/       # → Theme stylesheets
│   ├── functions.php     # → Composer autoloader, theme includes
│   ├── index.php         # → Never manually edit
│   ├── screenshot.png    # → Theme screenshot for WP admin
│   ├── style.css         # → Theme meta information
│   └── views/            # → Theme templates
│       ├── layouts/      # → Base templates
│       └── partials/     # → Partial templates
└── vendor/               # → Composer packages (never edit)

Theme development

Build commands

  • yarn run start — Compile assets when file changes are made, start Browsersync session
  • yarn run build — Compile and optimize the files in your assets directory
  • yarn run build:production — Compile assets for production

Todos

Make site title customizable in wp-admin. Make right side of footer customizable in wp-admin.

nasapress's People

Contributors

bruffridge avatar nasajones avatar treckart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nasapress's Issues

Install does not work on ubuntu 22 or windows 10

Performed the following on a brand new install:

  • installed apache2, mysql-server, php8.1
  • install and setup latest wordpress and database
  • tested default wp site works
  • apt install nodejs
  • apt install npm
  • curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
  • sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
  • npm update
  • npm install --global yarn
  • composer update (from nasapress theme dir)
  • composer install (from nasapress theme dir)
  • apt install pngquant
  • apt install libpng-dev
  • yarn (from nasapress theme dir)

Yarn seems to work:
yarn install v1.22.18
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 14.12s.

However, we receive an error when trying to preview or load the theme

Sage › Error
Theme must be activated prior to using the customizer.

This is after clicking "Activate". After doing that, the entire site fails to load.

Apache error.log shows the following:

[Sat May 21 11:07:56.329934 2022] [php:warn] [pid 44368] [client 192.168.11.237:7980] PHP Warning:  file_put_contents(/var/www/html/wp-content/uploads/cache/compiled/f4727a5b4c8b9602fbc0a5ff2c6ea65496d4503d.php): Failed to open stream: No such file or directory in /var/www/html/wp-content/themes/nasapress/vendor/illuminate/filesystem/Filesystem.php on line 122
[Sat May 21 11:07:56.330031 2022] [php:warn] [pid 44368] [client 192.168.11.237:7980] PHP Warning:  include(/var/www/html/wp-content/uploads/cache/compiled/f4727a5b4c8b9602fbc0a5ff2c6ea65496d4503d.php): Failed to open stream: No such file or directory in /var/www/html/wp-content/themes/nasapress/vendor/illuminate/view/Engines/PhpEngine.php on line 42
[Sat May 21 11:07:56.330043 2022] [php:warn] [pid 44368] [client 192.168.11.237:7980] PHP Warning:  include(): Failed opening '/var/www/html/wp-content/uploads/cache/compiled/f4727a5b4c8b9602fbc0a5ff2c6ea65496d4503d.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/wp-content/themes/nasapress/vendor/illuminate/view/Engines/PhpEngine.php on line 42

Odd Font Collision on Linux Chrome

Saw the announcement on Slack and figured I'd take a look. When I went to the Glenn site linked, I saw an odd collision on my Chrome browser:
screenshot at 2017-09-25 08-18-21
Note how the Glenn and the About Us are having a hard time together.

Now this is Linux + Chrome so the fault might be mine, but I'd thought I'd let you know. Note that the collision goes away at 110% zoom, so...maybe my default font size is too large?

Matt

PS: I like how at 150% zoom, it turns into a mobile-like site. Very cool.

NASAPress Live Preview and Customize Link

While testing in a multi-site instance of WordPress, I noticed the following behavior.

  1. Clicking on Live Preview option generates what appears to be an endless loop that eventually fails with a "The page isn’t redirecting properly" error. Functions.php does contain a note about the Live Preview button not functioning as expected.

  2. After activating the plugin, the theme has a Customize button. Clicking on it results in the same behavior as the issue noted above.

  3. After activating the theme, I clicked on the Customize link from the Admin menu. In the Customizer, there is a field called Active Theme. Normally, this field contains the name of the Theme. Instead, it contains a folder directory.

This is a great theme, though the directory structure is different from other WordPress themes I've reviewed.

Hoping there are plans to fix these bugs.

Thanks.

Updated code

The latest commit was a few years. I am running into problems getting this theme to work with modern/latest wordpress, npm, yarn, etc.

Can you please update the codebase and provide new install instructions. We very much want to use this theme for a NASA public website.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.