Giter Site home page Giter Site logo

yiisoft-contrib / yiiframework.com Goto Github PK

View Code? Open in Web Editor NEW
262.0 27.0 101.0 113.58 MB

Source code for official Yii website

Home Page: http://yiiframework.com/

License: Other

JavaScript 0.37% PHP 10.60% CSS 0.07% Shell 0.01% Makefile 0.04% Batchfile 0.02% SCSS 1.01% Dockerfile 0.01% HTML 87.87%
yii yii-framework website php

yiiframework.com's Introduction

Yii Framework Website

This project contains the source code for the yiiframework.com Website.

If you want to contribute please get in touch with us using the issue tracker.

Build Status

Prerequisites

Install Docker and Docker Compose.

docker-compose build
docker-compose up

The site will be available at http://localhost:81.

Generating screenshots

You can use the script run_pageres.sh at the root of the source directory to generate screenshots.

Initial setup

Adjust local config files if needed:

  • config/console-local.php.
  • config/params-local.php.
  • config/web-local.php.

Generate a personal Github token (from your Github profile settings section). Paste it in a file in the data directory (@app/data) called github.token (one line, no line-break).

Continue with the following commands:

# run migrations
./yii migrate

# fill RBAC
./yii rbac/up

# build contributors page (this may take some time as it downloads a lot of user avatars from github)
./yii contributors/generate

# If you're on Windows you have to manually symlink or copy
# %appdata%/npm/node_modules/browser-sync to your app's node_modules

# The next step is for building the API documentation and the Guide files.
# It is optional for the site to be working but you will have no API docs and Guide.
# This step includes cloning the Yii 1 and Yii 2 repositories and a lot of computation,
# so you might want to skip it on the first install.
#
# This also requires an instance of elasticsearch to be configured and running
# (if you do not have it, it will still run, but the site search will not work).
# It also assumes you have pdflatex installed for building PDF guide docs.
#
# You may also build only parts of the docs, run  make help  for the available commands.
make docs

# If you are using Docker image, you need to additionally pass VENDOR_DIR:
make docs VENDOR_DIR=$VENDOR_DIR

# Yii 1.0 API docs generation. They are already included in VCS. Run this only if layout has changed.
docker build -f Dockerfile.yii-1.0 -t yiiframeworkcom-yii-1.0 .
docker run -it -v $PWD/data/api-1.0:/code/data/api-1.0 yiiframeworkcom-yii-1.0

# populate the search index by running
./yii search/rebuild

/code/vendor/bin/apidoc guide data/yii-2.0/docs/guide-ru data/docs-offline/yii-docs-2.0-ru --interactive=0
./yii guide "2.0" --interactive=0

Data import

For importing data from the old website, the following steps are necessary:

  • import data by running ./yii import command
  • rebuild user badges by running ./yii badge/rebuild
  • calculate user ranking ./yii user/ranking.

If you don't have that data, you can work with dummy content:

  • To fill the database with dummy content, you may run the command ./yii fake-data. You may run it multiple times to generate more data.
  • rebuild user badges by running ./yii badge/rebuild.
  • calculate user ranking ./yii user/ranking.

To assign users extra permissions use ./yii rbac/assign.

Cron jobs

The following commands need to be set up to run on a regular basis:

command interval Purpose
yii sitemap/generate daily regenerate sitemap.xml
yii contributors/generate weekly update contributors list on team page
yii badge/update hourly update badges for users in badge_queue
yii cron/update-packagist hourly update packagist extension data
yii user/ranking daily update user ranking
yii github-progress hourly update Github progress data

Additionally, queue/listen should run as a daemon or queue/run as a cronjob.

Deployment

This section covers notes for deployment on a server, you may not need this for your dev env. OS is assumed to be Debian "bullseye".

apt-get install texlive-full python3-pygments git nodejs make

Maintenance

The contributors list and the avatar thumbnails is generated by a console command:

./yii contributors/generate

It will connect to Github via the API and fetch a list of contributors, generate data/contributors.json and thumbnail images of the user avatars in data/avatars and finally invoke Gulp to generate a sprite image and Sass code.

It would be a good idea to set up a Cron job to run that once in a while - perhaps once each month.

Directory structure

  commands/           contains console commands (controllers)
  config/             contains application configurations
  controllers/        contains Web controller classes
  data/               contains important data generated by different commands
  env/                contains environment-dependent files
  assets/
      src/
          fonts/      contains fonts
          scss/       contains Sass source files
          js/         contains JS source files
  mail/               contains view files for e-mails
  models/             contains model classes
  node_modules/       contains installed NPM packages
  runtime/            contains files generated during runtime
  scripts/            contains shell scripts
  vendor/             contains dependent 3rd-party packages
  views/              contains view files for the Web application
  web/                contains the entry script and Web resources

Development

Build

  • During development, run gulp to watch view, Sass and JS file changes and automatically build target CSS/JS files. This command will also launch a browser window which is connected to browsersync.
  • At any time, run gulp build to manually rebuild target CSS/JS files from source Sass/JS files.
  • If you only want to watch for changes, you can issue the command gulp watch
  • To build the assets for production, specify the production flag: gulp build --production or run npm run build

CSS Files

  • Use Sass files to define CSS styles.
  • All Sass files should be put under assets/src/scss and listed in assets/src/scss/all.scss.
  • Usually each controller corresponds to a single Sass file whose name is the same as the controller ID. For example, the GuideController has a Sass file named _guide.scss.
  • All Sass source files, except all.scss should have a leading underscore in the name. Sass will ignore files starting with an underscore so that only one CSS file will be produced (all.css).
  • For information about where each file should be put, please consult the master include file all.scss.

JS Files

  • All JS files should be put under assets/src/js and listed in config.yml.
  • Usually each controller corresponds to a single JS file whose name is the same as the controller ID. For example, the GuideController has a JS file named guide.js.

Links

yiiframework.com's People

Contributors

alexbs avatar arhell avatar arogachev avatar asamats avatar cebe avatar darkdef avatar dependabot[bot] avatar geertw avatar gmdmi avatar hirenbhut93 avatar insaneskull avatar jacmoe avatar johonunu avatar lesha724 avatar machour avatar marcovtwout avatar philippfrenzel avatar prodex avatar qiangxue avatar rawtaz avatar rob006 avatar robregonm avatar rustamwin avatar samdark avatar softark avatar sohelahmed7 avatar vishub avatar vjik avatar yidas avatar yiiliveext 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yiiframework.com's Issues

proposal for cronjobs

In my projects I usually have a crontab file in the config that is linked to /etc/cron.d/ on the server
so it is possible to configure cronjobs more explicit than having only a set of scripts for hourly, daily, etc...

Yii video

It's a good idea to put a short video explaining what is Yii right to the front page.

  • Should be short.
  • Yii is a PHP framework.
  • With Yii PHP doesn't suck :)
  • Enhances your productivity (after getting used to it).
  • Used by major players: Facebook, FIFA, VICE etc.
  • Demo of generating stuff with Gii, console, AR API.

More ideas?

Team members list

  1. Do we need team members list at the website?
  2. If not, is it a good idea to put a link to contributors GitHub page somewhere?

Provide PDF and CHM docs

These are really important and we should automatically build these from sources and provide a way to download these right from website.

Books section

  1. Do we want to display Yii-related books only?
  2. Do we need more than cover, Yii version and a link?

guide translation fallback

clicking through the guide I found that untranslated pages result in a 404 after choosing them from the navigation.
I suggest redirecting to the english version and displaying a flash messages that explains that the page has not been translated yet.

Where and how to store users?

It seems we have a problem with users.

  • We have at least 2 different domains: yiicamp.com and yiiframework.com.
  • User should be identified across these domains.
  • Some common data such as avatar, first and last name should be shared.

Additionally there are third party Yii-related projects such as language-specific community websites that will benefit from it.

Any suggestions on the solution?

UX issues with new front page

Overall it looks better but...

  • Guide text readablity adjustments from previous design lost (contrast, line width, spacing, font, visited link colors etc.)
  • Can't sign in if page is scrolled down. Inplace GitHub login could be sufficient for commenting the guide though.
  • Use updated logo from current yiiframework.com (w/o shadow). Consider redesigning it while keeping identity.
  • Learn menu pops out too much and is hard to navigate. We could remove description since these are more or less obvious from titles.
  • No quick access to guide / api which is critical for non-first visitors. Could be added to topmost grey bar.
  • Search behaves in a weird unusual way. At least it could auto-focus in the input.
  • Learn more and get started buttons are calls to action, need these to be more prominent.

News page?

where do we put the news section btw? should they be on yiicamp or yiiframework?
news should be coupled with the comunitiy to allow comments and discussion so I would tend to putting them on yiicamp...

Finish guides

  • style of 1.1/1.0 guide
    • image container has no style
    • Tip, Caution etc... hints should be styled (#77)
    • TOC has no style
  • style of 2.0 guide
    • Tip, Caution etc... hints should be styled (#77)
    • add TOC
  • PDF generation
    • 2.0
    • 1.1
  • PDF download
    • 2.0
    • 1.1
  • offline docs download
  • add blog tutorial

Need a monospace font

we already have two custom fonts for navigation and content:
118aa88

but monospace is not covered by these and it is smaller than the normal font even though it has the same font size setting...

bildschirmfoto vom 2015-06-05 22 14 25

@samdark can you find a font for monospace?

Finish API docs

  • style of 1.1/1.0 docs
    • navigation
    • ensure styling is okay
    • page titles
  • style of 2.0 docs
    • ensure styling is okay
    • page titles
  • offline docs download
  • ...

Getting started and entry points

Linking to the guide is not enough imo.

For "Getting started" there are basically two different entry points:

  1. install yii and get a working basic app as soon as possible
  2. know about what you need to know and learn and where to find help to get a deep understanding of yii

here is how we have these on IRC:

(23:05:38) CeBe: !faq start
(23:05:39) MrFisk: CeBe: 1) To get started with Yii 2, please read: http://www.yiiframework.com/doc-2.0/guide-README.html#getting-started 2) To learn more, please read the Yii 2 Guide: http://www.yiiframework.com/doc-2.0/guide-README.html 3) Get to know the API docs at http://www.yiiframework.com/doc-2.0/ - you'll use them every day. You can view Yii source code directly in the API docs. The API search box is invaluable.

(23:05:43) CeBe: !faq learn
(23:05:43) MrFisk: CeBe: Here is a step by step To-Do list for Yii beginners. The list is an advice of what tutorials and documentation you can walk through to get a full understanding of the Yii Framework. These can be a help to learn Yii. http://www.yiiframework.com/wiki/268/how-to-learn-yii

Sticky main navigation causes problem with hashlinks

Currently the main navigation causes problems with hash links. linking to a section in the guide or to a method will hide the headline behind the navigation.

two possible solutions:

  1. disable stickyness of navigation
  2. add some JS that scrolls down 74px every time the hash changes

Keep track of old content

This is to track old content that will be kept on the new site and possibly necessary redirects.

old new status
/about/ About Yii /about and /team #50 (comment)
/features/ redirect to front page #5
/performance/ redirect to front page
/license/ /license
/contact/ /contact
/download/ /download
/extensions/* /extensions #15
/demos/ redirect to front page
/logo/ /logo/ ✅ logo itself should be adjusted (remove shadow)
/doc/ /books ✅ (no need for a redirect but /doc should point somewhere)
/tour/ "Getting started" link ☑️ #49 draft version done, need improvements
/tutorials/ Redirect to /resources
/doc/api/* /doc/api/* ✅ (#34)
/doc/guide/* /doc/guide/* ✅ (#33)
/doc/blog/* linked from ressources now, url is same ✅ (#32)
/doc-2.0/* redirect to /doc/*
/wiki/* /wiki #16
/screencasts/ Redirect to /resources
/resources/ /resources
/contribute/ /contribute
/security/ /security
/forum/* should stay as is ☑️ #84
/chat/ /chat
/community/ /community
/news/ /news ✅ (#47)
/user/* /user/*
/user/halloffame/ /user/halloffame
/badges/ /badges
/tos/ /tos ✅ (#48)
/rss.xml/ /rss.xml

Responsiveness

This issue lists things that need to be fixed for the site to work on mobile devices:

  • Guide menu is completely hidden on mobile device. should become a dropdown like language and version instead.
  • ...

UX and Design of new sites

I've asked my partner usability-expert for help with new UX&Design.
For the start he created mood board(login as guest for quick look).
The goal of mood board is to pick overall stylistics of new sites. It is done for specifying the vector of UX prototyping and future design.
Note, that this is only stylistics - the final color-style will be the same as yii branded colors.
Please take a look at mood board and tell your opinion.
The next step is usability prototyping based on #40 requires a decision.

Front page

yii_frontpage

What do you think about such structure (not visual design) of the front page?

Download/install page

Was it meant to lead to user guide or internals guide on how to develop Yii itself?

new extension repository

features:

  • display readme from github
  • allow download and composer install
  • render api docs and a guide
  • link authors from github and display them (yiicamp login should be possible via github)
  • ...

Add a "got to top" arrow

it should be available as soon as you scroll down and bring you back to the top.

should remove the top button from apidoc then.

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.