├── .circleci └── config.yml ├── .editorconfig ├── .eslintrc.js ├── .github ├── CODEOWNERS ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── Bug_report.md │ ├── Enhancement.md │ └── Feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml ├── labeler.yml └── workflows │ ├── auto-merge.yml │ ├── changelog.yml │ └── main.yml ├── .gitignore ├── .hooks └── pre-push ├── .nvmrc ├── .prettierignore ├── .prettierrc.js ├── .releaserc.js ├── .stylelintrc.js ├── CHANGELOG.md ├── LICENSE ├── README.md ├── babel.config.js ├── commitlint.config.js ├── composer.json ├── composer.lock ├── newspack-joseph ├── fonts │ ├── eb-garamond │ │ ├── EBGaramond-Bold.ttf │ │ ├── EBGaramond-BoldItalic.ttf │ │ ├── EBGaramond-Italic.ttf │ │ ├── EBGaramond-Regular.ttf │ │ └── OFL.txt │ └── old-standard-tt │ │ ├── OFL.txt │ │ ├── OldStandardTT-Bold.ttf │ │ ├── OldStandardTT-Italic.ttf │ │ └── OldStandardTT-Regular.ttf ├── functions.php ├── inc │ ├── child-color-patterns.php │ └── child-typography.php ├── sass │ ├── style-editor.scss │ ├── style.scss │ ├── theme-description.scss │ └── variables-style │ │ └── _variables-style.scss ├── screenshot.png └── tribe-events │ └── tribe-events.scss ├── newspack-katharine ├── fonts │ └── barlow │ │ ├── Barlow-Bold.ttf │ │ ├── Barlow-BoldItalic.ttf │ │ ├── Barlow-Italic.ttf │ │ ├── Barlow-Regular.ttf │ │ └── OFL.txt ├── functions.php ├── inc │ ├── child-color-patterns.php │ └── child-typography.php ├── sass │ ├── style-editor.scss │ ├── style.scss │ ├── theme-description.scss │ └── variables-style │ │ └── _variables-style.scss ├── screenshot.png └── tribe-events │ └── tribe-events.scss ├── newspack-nelson ├── fonts │ └── montserrat │ │ ├── Montserrat-Bold.ttf │ │ ├── Montserrat-ExtraBold.ttf │ │ ├── Montserrat-Medium.ttf │ │ ├── Montserrat-MediumItalic.ttf │ │ └── OFL.txt ├── functions.php ├── inc │ ├── child-color-patterns.php │ └── child-typography.php ├── sass │ ├── style-editor.scss │ ├── style.scss │ ├── theme-description.scss │ └── variables-style │ │ └── _variables-style.scss ├── screenshot.png └── tribe-events │ └── tribe-events.scss ├── newspack-sacha ├── fonts │ └── ibm-plex-serif │ │ ├── IBMPlexSerif-Bold.ttf │ │ ├── IBMPlexSerif-BoldItalic.ttf │ │ ├── IBMPlexSerif-Italic.ttf │ │ ├── IBMPlexSerif-Regular.ttf │ │ └── OFL.txt ├── functions.php ├── inc │ ├── child-color-patterns.php │ └── child-typography.php ├── sass │ ├── child-style-editor-overrides.scss │ ├── style-editor.scss │ ├── style.scss │ ├── theme-description.scss │ └── variables-style │ │ └── _variables-style.scss ├── screenshot.png ├── template-parts │ └── post │ │ └── author-bio.php └── tribe-events │ └── tribe-events.scss ├── newspack-scott ├── fonts │ └── fira-sans-condensed │ │ ├── FiraSansCondensed-Italic.ttf │ │ ├── FiraSansCondensed-Regular.ttf │ │ ├── FiraSansCondensed-SemiBold.ttf │ │ ├── FiraSansCondensed-SemiBoldItalic.ttf │ │ └── OFL.txt ├── functions.php ├── inc │ ├── child-color-patterns.php │ └── child-typography.php ├── sass │ ├── style-editor.scss │ ├── style.scss │ ├── theme-description.scss │ └── variables-style │ │ └── _variables-style.scss ├── screenshot.png └── tribe-events │ └── tribe-events.scss ├── newspack-theme ├── 404.php ├── archive-newspack_correction.php ├── archive.php ├── classes │ ├── class-newspack-svg-icons.php │ └── class-newspack-walker-comment.php ├── comments.php ├── fonts │ ├── NonBreakingSpaceOverride.woff │ └── NonBreakingSpaceOverride.woff2 ├── footer.php ├── front-page.php ├── functions.php ├── header.php ├── image.php ├── inc │ ├── back-compat.php │ ├── color-patterns.php │ ├── customizer.php │ ├── icon-functions.php │ ├── jetpack.php │ ├── login-screen.php │ ├── logo-resizer.php │ ├── newspack-multibranded-site-plugin.php │ ├── newspack-newsletters.php │ ├── newspack-sponsors.php │ ├── template-functions.php │ ├── template-tags.php │ ├── the-events-calendar.php │ ├── trust-indicators.php │ ├── typography.php │ ├── web-stories.php │ ├── woocommerce.php │ ├── yoast-bluesky-contact-method.php │ └── yoast.php ├── index.php ├── js │ ├── originals │ │ └── skip-link-focus-fix.js │ └── src │ │ ├── amp-fallback-newspack-sponsors.js │ │ ├── amp-fallback.js │ │ ├── customize-controls.js │ │ ├── customize-preview.js │ │ ├── editor-remove-blocks.js │ │ ├── extend-featured-image-editor.js │ │ ├── font-loading.js │ │ ├── logo-customize-controls.js │ │ ├── logo-customize-preview.js │ │ ├── menu-accessibility.js │ │ ├── post-meta-toggles.js │ │ ├── post-subtitle │ │ ├── SubtitleEditor.js │ │ ├── index.js │ │ └── utils.js │ │ ├── post-summary │ │ ├── SummaryEditor.js │ │ ├── SummaryTitleEditor.js │ │ ├── index.js │ │ └── utils.js │ │ └── relative-time.js ├── languages │ ├── de_DE.mo │ ├── de_DE.po │ ├── es_ES.mo │ ├── es_ES.po │ ├── fr_BE.mo │ ├── fr_BE.po │ ├── newspack-de_DE-1214ebc007983574185a9f0914311f01.json │ ├── newspack-de_DE-5fc520bf9874d4f5fca37c405ec1d21a.json │ ├── newspack-de_DE-833a9c337dfe3a093d473e3fc210e521.json │ ├── newspack-de_DE-df181a26eb62f21273525d59fc065434.json │ ├── newspack-es_ES-1214ebc007983574185a9f0914311f01.json │ ├── newspack-es_ES-5fc520bf9874d4f5fca37c405ec1d21a.json │ ├── newspack-es_ES-833a9c337dfe3a093d473e3fc210e521.json │ ├── newspack-es_ES-df181a26eb62f21273525d59fc065434.json │ ├── newspack-fr_BE-1214ebc007983574185a9f0914311f01.json │ ├── newspack-fr_BE-5fc520bf9874d4f5fca37c405ec1d21a.json │ ├── newspack-fr_BE-833a9c337dfe3a093d473e3fc210e521.json │ ├── newspack-fr_BE-df181a26eb62f21273525d59fc065434.json │ ├── newspack-pl_PL-1214ebc007983574185a9f0914311f01.json │ ├── newspack-pl_PL-5fc520bf9874d4f5fca37c405ec1d21a.json │ ├── newspack-pl_PL-833a9c337dfe3a093d473e3fc210e521.json │ ├── newspack-pl_PL-df181a26eb62f21273525d59fc065434.json │ ├── newspack-pt_BR-1214ebc007983574185a9f0914311f01.json │ ├── newspack-pt_BR-5fc520bf9874d4f5fca37c405ec1d21a.json │ ├── newspack-pt_BR-833a9c337dfe3a093d473e3fc210e521.json │ ├── newspack-pt_BR-df181a26eb62f21273525d59fc065434.json │ ├── newspack-pt_PT-1214ebc007983574185a9f0914311f01.json │ ├── newspack-pt_PT-5fc520bf9874d4f5fca37c405ec1d21a.json │ ├── newspack-pt_PT-833a9c337dfe3a093d473e3fc210e521.json │ ├── newspack-pt_PT-df181a26eb62f21273525d59fc065434.json │ ├── newspack-theme.pot │ ├── pl_PL.mo │ ├── pl_PL.po │ ├── pt_BR.mo │ ├── pt_BR.po │ ├── pt_PT.mo │ └── pt_PT.po ├── no-header-footer.php ├── offline.php ├── page.php ├── sass │ ├── _normalize.scss │ ├── blocks │ │ ├── _blocks.scss │ │ └── _patterns.scss │ ├── elements │ │ ├── _elements.scss │ │ ├── _lists.scss │ │ └── _tables.scss │ ├── forms │ │ ├── _amp.scss │ │ ├── _buttons.scss │ │ ├── _fields.scss │ │ ├── _forms.scss │ │ └── _search.scss │ ├── layout │ │ └── _layout.scss │ ├── media │ │ ├── _captions.scss │ │ ├── _galleries.scss │ │ └── _media.scss │ ├── mixins │ │ ├── _mixins-main.scss │ │ └── _utilities.scss │ ├── modules │ │ ├── _accessibility.scss │ │ ├── _alignments.scss │ │ └── _clearings.scss │ ├── navigation │ │ ├── _infinite-scroll.scss │ │ ├── _links.scss │ │ ├── _menu-dropdown.scss │ │ ├── _menu-highlight-navigation.scss │ │ ├── _menu-main-navigation.scss │ │ ├── _menu-mobile-navigation.scss │ │ ├── _menu-secondary-navigation.scss │ │ ├── _menu-social-navigation.scss │ │ ├── _menu-tertiary-navigation.scss │ │ ├── _navigation.scss │ │ └── _next-previous.scss │ ├── plugins │ │ ├── newspack-ads.scss │ │ ├── newspack-listings.scss │ │ ├── newspack-newsletters-editor.scss │ │ ├── newspack-publisher-media-kit.scss │ │ ├── newspack-sponsors-editor.scss │ │ ├── newspack-sponsors.scss │ │ ├── the-events-calendar.scss │ │ ├── trust-indicators.scss │ │ ├── woocommerce.scss │ │ └── yoast-breadcrumb.scss │ ├── print.scss │ ├── site │ │ ├── _site.scss │ │ ├── footer │ │ │ └── _site-footer.scss │ │ ├── header │ │ │ └── _site-header.scss │ │ ├── primary │ │ │ ├── _archives.scss │ │ │ ├── _comments.scss │ │ │ └── _posts-and-pages.scss │ │ └── secondary │ │ │ └── _widgets.scss │ ├── style-base.scss │ ├── style-editor-base.scss │ ├── style-editor-customizer.scss │ ├── style-editor-overrides.scss │ ├── style-editor.scss │ ├── style.scss │ ├── styles │ │ └── style-default │ │ │ ├── style-default-editor.scss │ │ │ └── style-default.scss │ ├── theme-description.scss │ ├── typography │ │ ├── _copy.scss │ │ ├── _headings.scss │ │ └── _typography.scss │ └── variables-site │ │ ├── _colors.scss │ │ ├── _fonts.scss │ │ ├── _newspack-ui.scss │ │ ├── _structure.scss │ │ ├── _transitions.scss │ │ └── _variables-site.scss ├── screenshot.png ├── search.php ├── searchform.php ├── sidebar.php ├── single-feature.php ├── single-wide.php ├── single.php ├── template-parts │ ├── content │ │ ├── content-archive.php │ │ ├── content-corrections.php │ │ ├── content-excerpt.php │ │ ├── content-none.php │ │ ├── content-page.php │ │ ├── content-single.php │ │ └── content.php │ ├── footer │ │ ├── below-footer-widgets.php │ │ ├── footer-branding.php │ │ └── footer-widgets.php │ ├── header │ │ ├── desktop-sidebar.php │ │ ├── entry-header.php │ │ ├── header-search.php │ │ ├── mobile-sidebar.php │ │ ├── site-branding.php │ │ └── subpage-sidebar.php │ └── post │ │ ├── author-bio.php │ │ ├── discussion-meta.php │ │ └── large-featured-image.php ├── tribe-events │ └── tribe-events.scss ├── tribe │ └── events │ │ └── v2 │ │ └── default-template.php └── woocommerce │ ├── order │ └── order-details-customer.php │ └── templates.php ├── package-lock.json ├── package.json ├── phpcs.xml ├── phpcs.xml.dist ├── phpstan.neon.dist ├── readme.txt ├── scripts ├── compile-scss.js └── create-child-releases.js ├── tests ├── bootstrap.php └── functions-stubs.php └── webpack.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # WordPress Coding Standards 2 | # https://make.wordpress.org/core/handbook/coding-standards/ 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | indent_style = tab 12 | 13 | [{package.json,*.yml}] 14 | indent_style = space 15 | indent_size = 2 16 | 17 | [{*.txt,wp-config-sample.php}] 18 | end_of_line = crlf 19 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | require( '@rushstack/eslint-patch/modern-module-resolution' ); 2 | 3 | module.exports = { 4 | extends: [ './node_modules/newspack-scripts/config/eslintrc.js' ], 5 | }; 6 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @Automattic/newspack-product 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Describe the issue** 2 | A clear and concise description of what the bug is. Please be as descriptive as possible; issues lacking detail, or for any other reason than to report a bug, may be closed without action. 3 | 4 | **To Reproduce** 5 | Steps to reproduce the behavior: 6 | 1. Go to '...' 7 | 2. Click on '....' 8 | 3. Scroll down to '....' 9 | 4. See error 10 | 11 | **Screenshots** 12 | If applicable, add screenshots to help explain your problem. 13 | 14 | **Expected behavior** 15 | A clear and concise description of what you expected to happen. 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F41E Bug report" 3 | about: Report a bug if something isn't working as expected. 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. Please be as descriptive as possible; issues lacking detail, or for any other reason than to report a bug, may be closed without action. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Screenshots** 18 | If applicable, add screenshots to help explain your problem. 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "✨ New Enhancement" 3 | about: "If you have an idea to improve an existing feature please let us know or submit a Pull Request!" 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F680 Feature request" 3 | about: "Suggest a new feature \U0001F389 We'll consider building it if it receives sufficient interest! \U0001F44D" 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### All Submissions: 2 | 3 | * [ ] Have you followed the [Newspack Contributing guideline](https://github.com/Automattic/newspack-theme/blob/trunk/.github/CONTRIBUTING.md)? 4 | * [ ] Does your code follow the [WordPress' coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) and [VIP Go coding standards](https://vip.wordpress.com/documentation/vip-go/code-review-blockers-warnings-notices/)? 5 | * [ ] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change? 6 | 7 | 8 | 9 | 10 | 11 | ### Changes proposed in this Pull Request: 12 | 13 | 14 | 15 | Closes # . 16 | 17 | ### How to test the changes in this Pull Request: 18 | 19 | 1. 20 | 2. 21 | 3. 22 | 23 | ### Other information: 24 | 25 | * [ ] Have you added an explanation of what your changes do and why you'd like us to include them? 26 | * [ ] Have you written new tests for your changes, as applicable? 27 | * [ ] Have you successfully ran tests with your changes locally? 28 | 29 | 30 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Dependabot config. 2 | # Keep NPM and Composer packages up-to-date. 3 | # Let's start out with weekly updates and then drop back to less frequent intervals after everything is up-to-date. 4 | 5 | version: 2 6 | updates: 7 | # Enable version updates for npm 8 | - package-ecosystem: 'npm' 9 | # Look for `package.json` and `lock` files in the `root` directory 10 | directory: '/' 11 | # Check the npm registry for updates every day (weekdays) 12 | schedule: 13 | interval: 'weekly' 14 | # Add reviewers 15 | reviewers: 16 | - 'Automattic/newspack-product' 17 | 18 | # Enable version updates for Composer 19 | - package-ecosystem: 'composer' 20 | # Look for a `composer.lock` in the `root` directory 21 | directory: '/' 22 | # Check for updates every day (weekdays) 23 | schedule: 24 | interval: 'weekly' 25 | # Add reviewers 26 | reviewers: 27 | - 'Automattic/newspack-product' 28 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | needs-changelog: 2 | - base-branch: ['trunk'] 3 | -------------------------------------------------------------------------------- /.github/workflows/auto-merge.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request_target: 3 | types: [labeled] 4 | 5 | name: Dependabot auto-merge 6 | jobs: 7 | auto-merge: 8 | name: Auto-merge dependabot PRs for minor and patch updates 9 | runs-on: ubuntu-latest 10 | if: | 11 | contains( github.event.pull_request.labels.*.name, 'dependencies' ) 12 | && ! contains( github.event.pull_request.labels.*.name, '[Status] Approved' ) 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: ahmadnassri/action-dependabot-auto-merge@v2 16 | with: 17 | target: minor # includes patch updates. 18 | github-token: ${{ secrets.DEPENDABOT_TOKEN }} 19 | -------------------------------------------------------------------------------- /.github/workflows/changelog.yml: -------------------------------------------------------------------------------- 1 | name: "Pull Request Labeler" 2 | on: 3 | pull_request: 4 | types: [closed] 5 | 6 | jobs: 7 | labeler: 8 | if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'trunk' && github.event.pull_request.user.login != 'dependabot[bot]' 9 | permissions: 10 | contents: read 11 | pull-requests: write 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/labeler@v5 15 | 16 | comment_pr: 17 | if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'trunk' && github.event.pull_request.user.login != 'dependabot[bot]' 18 | permissions: 19 | contents: read 20 | pull-requests: write 21 | runs-on: ubuntu-latest 22 | name: Comment about the change log label 23 | steps: 24 | - name: Comment PR 25 | uses: thollander/actions-comment-pull-request@v3 26 | with: 27 | message: | 28 | Hey @${{ github.event.pull_request.user.login }}, good job getting this PR merged! :tada: 29 | 30 | Now, the `needs-changelog` label has been added to it. 31 | 32 | Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. 33 | 34 | If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. 35 | 36 | Thank you! :heart: 37 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: pull_request_review 2 | name: Label approved pull requests 3 | jobs: 4 | labelWhenApproved: 5 | name: Label when approved 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: Label when approved 9 | uses: abinoda/label-when-approved-action@master 10 | env: 11 | APPROVALS: '1' 12 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 13 | ADD_LABEL: '[Status] Approved' 14 | # Needs to be URL-encoded, see https://github.com/abinoda/label-when-approved-action/pull/3#discussion_r321882620 15 | REMOVE_LABEL: '%5BStatus%5D%20Needs%20Review' 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Editors 2 | project.xml 3 | project.properties 4 | /nbproject/private/ 5 | .buildpath 6 | .project 7 | .settings* 8 | .idea 9 | .vscode 10 | *.sublime-project 11 | *.sublime-workspace 12 | .sublimelinterrc 13 | 14 | # NPM 15 | /node_modules/ 16 | .cache 17 | 18 | # Sass 19 | .sass-cache/ 20 | 21 | # OS X metadata 22 | .DS_Store 23 | 24 | # Windows junk 25 | Thumbs.db 26 | 27 | # Composer 28 | /vendor/ 29 | 30 | # Compiled CSS 31 | /styles/ 32 | *.css 33 | 34 | # Compiled Javascript 35 | newspack-*/js/dist/ 36 | 37 | # Release folder 38 | release/ 39 | -------------------------------------------------------------------------------- /.hooks/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') 4 | 5 | if [[ "$branch" = "trunk" ]]; then 6 | echo "Error: pushing directly to the trunk branch is prohibited" 7 | exit 1 8 | fi 9 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/* -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | release 4 | vendor -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require( './node_modules/newspack-scripts/config/prettier.config.js' ); 2 | 3 | module.exports = { 4 | ...baseConfig 5 | }; 6 | -------------------------------------------------------------------------------- /.releaserc.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | 3 | const { THEMES } = require( './scripts/create-child-releases.js' ); 4 | 5 | module.exports = { 6 | branches: [ 7 | // `release` branch is published on the main distribution channel (a new version on GH). 8 | 'release', 9 | // `alpha` branch – for regular pre-releases. 10 | { 11 | name: 'alpha', 12 | prerelease: true, 13 | }, 14 | // `hotfix/*` branches – for releases outside of the release schedule. 15 | { 16 | name: 'hotfix/*', 17 | // With `prerelease: true`, the `name` would be used for the pre-release tag. A name with a `/` 18 | // is not valid, though. See https://semver.org/#spec-item-9. 19 | prerelease: '${name.replace(/\\//g, "-")}', 20 | }, 21 | // `epic/*` branches – for beta testing/QA pre-release builds. 22 | { 23 | name: 'epic/*', 24 | // With `prerelease: true`, the `name` would be used for the pre-release tag. A name with a `/` 25 | // is not valid, though. See https://semver.org/#spec-item-9. 26 | prerelease: '${name.replace(/\\//g, "-")}', 27 | }, 28 | ], 29 | prepare: [ 30 | '@semantic-release/changelog', 31 | '@semantic-release/npm', 32 | [ 33 | 'semantic-release-version-bump', 34 | { 35 | // build script is run before semantic-release, so the version in *.css files 36 | // have to be updated explicitly 37 | files: [ 'newspack-*/sass/theme-description.scss', 'newspack-*/style.css' ], 38 | callback: 'npm run release:archive', 39 | }, 40 | ], 41 | { 42 | path: '@semantic-release/git', 43 | assets: [ 44 | ...THEMES.map( name => `${ name }/sass/theme-description.scss` ), 45 | 'package.json', 46 | 'package-lock.json', 47 | 'CHANGELOG.md', 48 | ], 49 | message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}', 50 | }, 51 | ], 52 | plugins: [ 53 | '@semantic-release/commit-analyzer', 54 | '@semantic-release/release-notes-generator', 55 | [ 56 | '@semantic-release/npm', 57 | { 58 | npmPublish: false, 59 | }, 60 | ], 61 | 'semantic-release-version-bump', 62 | [ 63 | '@semantic-release/github', 64 | { 65 | assets: THEMES.map( name => ( { 66 | path: `./release/${ name }.zip`, 67 | label: `${ name }.zip`, 68 | } ) ), 69 | }, 70 | ], 71 | ], 72 | }; 73 | -------------------------------------------------------------------------------- /.stylelintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ignoreFiles: [ 3 | '**/dist/**', 4 | '**/node_modules/**', 5 | '**/release/**', 6 | '**/scripts/**', 7 | ], 8 | extends: [ './node_modules/newspack-scripts/config/stylelint.config.js' ], 9 | }; 10 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = api => { 2 | api.cache( true ); 3 | return { 4 | extends: 'newspack-scripts/config/babel.config.js', 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: [ '@commitlint/config-conventional' ] }; 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "automattic/newspack-theme", 3 | "description": "A theme for Newspack. https://newspack.com/", 4 | "homepage": "https://newspack.com/", 5 | "type": "package", 6 | "license": "GPL-2.0-or-later", 7 | "support": { 8 | "issues": "https://github.com/Automattic/newspack-theme/issues" 9 | }, 10 | "require-dev": { 11 | "composer/installers": "~2.0", 12 | "automattic/vipwpcs": "^2.0", 13 | "wp-coding-standards/wpcs": "^2.1", 14 | "phpcompatibility/phpcompatibility-wp": "^2.1", 15 | "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", 16 | "brainmaestro/composer-git-hooks": "^3.0", 17 | "wptrt/wpthemereview": "*", 18 | "szepeviktor/phpstan-wordpress": "^2.0" 19 | }, 20 | "scripts": { 21 | "phpcs-i": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs -i", 22 | "lint": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs", 23 | "format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf", 24 | "post-install-cmd": [ 25 | "vendor/bin/cghooks add --no-lock", 26 | "PHPStan\\WordPress\\Composer\\FixWpStubs::php73Polyfill" 27 | ], 28 | "post-update-cmd": [ 29 | "vendor/bin/cghooks update", 30 | "PHPStan\\WordPress\\Composer\\FixWpStubs::php73Polyfill" 31 | ] 32 | }, 33 | "extra": { 34 | "hooks": { 35 | "pre-commit": "./node_modules/.bin/lint-staged", 36 | "pre-push": "./.hooks/pre-push", 37 | "commit-msg": [ 38 | "cat $1 | ./node_modules/.bin/newspack-scripts commitlint" 39 | ] 40 | } 41 | }, 42 | "config": { 43 | "platform": { 44 | "php": "8.0" 45 | }, 46 | "allow-plugins": { 47 | "composer/installers": true, 48 | "dealerdirect/phpcodesniffer-composer-installer": true 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /newspack-joseph/fonts/eb-garamond/EBGaramond-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-joseph/fonts/eb-garamond/EBGaramond-Bold.ttf -------------------------------------------------------------------------------- /newspack-joseph/fonts/eb-garamond/EBGaramond-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-joseph/fonts/eb-garamond/EBGaramond-BoldItalic.ttf -------------------------------------------------------------------------------- /newspack-joseph/fonts/eb-garamond/EBGaramond-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-joseph/fonts/eb-garamond/EBGaramond-Italic.ttf -------------------------------------------------------------------------------- /newspack-joseph/fonts/eb-garamond/EBGaramond-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-joseph/fonts/eb-garamond/EBGaramond-Regular.ttf -------------------------------------------------------------------------------- /newspack-joseph/fonts/old-standard-tt/OldStandardTT-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-joseph/fonts/old-standard-tt/OldStandardTT-Bold.ttf -------------------------------------------------------------------------------- /newspack-joseph/fonts/old-standard-tt/OldStandardTT-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-joseph/fonts/old-standard-tt/OldStandardTT-Italic.ttf -------------------------------------------------------------------------------- /newspack-joseph/fonts/old-standard-tt/OldStandardTT-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-joseph/fonts/old-standard-tt/OldStandardTT-Regular.ttf -------------------------------------------------------------------------------- /newspack-joseph/inc/child-color-patterns.php: -------------------------------------------------------------------------------- 1 | li, 53 | .h-sb.h-sh .nav1 ul.main-menu > li > a, 54 | .h-sb.h-sh .nav1 ul.main-menu > li > a:hover, 55 | .h-sb .top-header-contain, 56 | .h-sb .middle-header-contain { 57 | color: ' . esc_html( $header_color_contrast ) . '; 58 | } 59 | '; 60 | } 61 | 62 | if ( isset( $footer_color ) && '' !== $footer_color ) { 63 | $theme_css .= ' 64 | #colophon, 65 | #colophon .widget-title, 66 | #colophon .widgettitle, 67 | #colophon .social-navigation a { 68 | color: ' . esc_html( $footer_color_contrast ) . '; 69 | } 70 | 71 | #colophon .footer-branding .wrapper, 72 | #colophon .footer-widgets:first-child { 73 | border-top: 0; 74 | } 75 | '; 76 | } 77 | 78 | $editor_css = ''; 79 | 80 | if ( function_exists( 'register_block_type' ) && is_admin() ) { 81 | $theme_css = $editor_css; 82 | } 83 | 84 | return $theme_css; 85 | } 86 | -------------------------------------------------------------------------------- /newspack-joseph/inc/child-typography.php: -------------------------------------------------------------------------------- 1 | li, 50 | .h-sb.h-sh .site-header .nav1 ul.main-menu > li > a, 51 | .h-sb.h-sh .site-header .nav1 ul.main-menu > li > a:hover, 52 | .h-sb .top-header-contain, 53 | .h-sb .middle-header-contain { 54 | color: ' . esc_html( $header_color_contrast ) . '; 55 | } 56 | 57 | .mobile-sidebar div.wpnbha .article-section-title::before, 58 | .mobile-sidebar .accent-header::before { 59 | background-color: ' . esc_html( newspack_adjust_brightness( $header_color, -30 ) ) . '; 60 | } 61 | '; 62 | } 63 | } 64 | 65 | if ( isset( $footer_color ) && '' !== $footer_color ) { 66 | $theme_css .= ' 67 | .footer-branding .wrapper { 68 | border-bottom-color: ' . esc_html( newspack_adjust_brightness( $footer_color, -20 ) ) . '; 69 | } 70 | 71 | .site-footer div.wpnbha .article-section-title::before, 72 | .site-footer .accent-header::before { 73 | background-color: ' . esc_html( newspack_adjust_brightness( $footer_color, -20 ) ) . '; 74 | } 75 | '; 76 | } 77 | 78 | if ( function_exists( 'register_block_type' ) && is_admin() ) { 79 | $theme_css = $editor_css; 80 | } 81 | 82 | return $theme_css; 83 | } 84 | -------------------------------------------------------------------------------- /newspack-katharine/inc/child-typography.php: -------------------------------------------------------------------------------- 1 | li, 50 | .h-sb.h-sh .nav1 ul.main-menu > li > a, 51 | .h-sb.h-sh .nav1 ul.main-menu > li > a:hover, 52 | .h-sb .top-header-contain, 53 | .h-sb .middle-header-contain { 54 | color: ' . esc_html( $header_color_contrast ) . '; 55 | } 56 | '; 57 | } 58 | } 59 | 60 | if ( isset( $footer_color ) && '' !== $footer_color ) { 61 | $theme_css .= ' 62 | .site-footer .widget .widget-title, 63 | .site-footer .widget .widgettitle, 64 | .site-info a:visited { 65 | color: ' . esc_html( $footer_color_contrast ) . '; 66 | } 67 | 68 | .site-info { 69 | background-color: ' . esc_html( newspack_adjust_brightness( $footer_color, -10 ) ) . '; 70 | } 71 | '; 72 | } 73 | 74 | if ( function_exists( 'register_block_type' ) && is_admin() ) { 75 | $theme_css = $editor_css; 76 | } 77 | 78 | return $theme_css; 79 | } 80 | -------------------------------------------------------------------------------- /newspack-sacha/inc/child-typography.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 |
15 | 16 |
17 | 20 | 21 |
22 |

23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 | 12 | 13 |
14 | 15 | 27 | 28 | 29 | 30 |
31 | 32 | 2, 51 | 'prev_text' => __( 'Previous', 'newspack' ), 52 | 'next_text' => __( 'Next', 'newspack' ), 53 | ) 54 | ); 55 | 56 | // If no content, include the "No posts found" template. 57 | else : 58 | get_template_part( 'template-parts/content/content', 'none' ); 59 | 60 | endif; 61 | ?> 62 |
63 | 69 |
70 | 71 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /newspack-theme/front-page.php: -------------------------------------------------------------------------------- 1 | 12 |
13 |
14 | 15 | 21 | 22 |
23 | 24 |
25 | 26 | 36 | 37 |
38 |
39 | 40 |

%s

', $message ); 40 | } 41 | 42 | /** 43 | * Prevents the Customizer from being loaded on WordPress versions prior to 4.7. 44 | * 45 | * @since Newspack Theme 1.0.0 46 | * 47 | * @global string $wp_version WordPress version. 48 | */ 49 | function newspack_customize() { 50 | wp_die( 51 | sprintf( 52 | __( 'Newspack Theme requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'newspack' ), 53 | $GLOBALS['wp_version'] 54 | ), 55 | '', 56 | array( 57 | 'back_link' => true, 58 | ) 59 | ); 60 | } 61 | add_action( 'load-customize.php', 'newspack_customize' ); 62 | 63 | /** 64 | * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.7. 65 | * 66 | * @since Newspack Theme 1.0.0 67 | * 68 | * @global string $wp_version WordPress version. 69 | */ 70 | function newspack_preview() { 71 | if ( isset( $_GET['preview'] ) ) { 72 | wp_die( sprintf( __( 'Newspack Theme requires at least WordPress version 4.7. You are running version %s. Please upgrade and try again.', 'newspack' ), $GLOBALS['wp_version'] ) ); 73 | } 74 | } 75 | add_action( 'template_redirect', 'newspack_preview' ); 76 | -------------------------------------------------------------------------------- /newspack-theme/inc/icon-functions.php: -------------------------------------------------------------------------------- 1 | theme_location ) { 45 | $svg = newspack_get_social_link_svg( $item->url, 26 ); 46 | if ( empty( $svg ) ) { 47 | $svg = newspack_get_icon_svg( 'link' ); 48 | } 49 | $item_output = str_replace( $args->link_after, '' . $svg, $item_output ); 50 | } 51 | 52 | return $item_output; 53 | } 54 | add_filter( 'walker_nav_menu_start_el', 'newspack_nav_menu_social_icons', 10, 4 ); 55 | -------------------------------------------------------------------------------- /newspack-theme/inc/newspack-newsletters.php: -------------------------------------------------------------------------------- 1 | add_section( 17 | 'newspack_tec_options', 18 | array( 19 | 'title' => esc_html__( 'Newspack Options', 'newspack' ), 20 | 'panel' => 'tribe_customizer', 21 | ) 22 | ); 23 | 24 | $wp_customize->add_setting( 25 | 'newspack_tec_sidebar_single', 26 | array( 27 | 'default' => false, 28 | 'sanitize_callback' => 'newspack_sanitize_checkbox', 29 | ) 30 | ); 31 | $wp_customize->add_control( 32 | 'newspack_tec_sidebar_single', 33 | array( 34 | 'type' => 'checkbox', 35 | 'label' => esc_html__( 'Show sidebar on single events', 'newspack' ), 36 | 'section' => 'newspack_tec_options', 37 | ) 38 | ); 39 | } 40 | add_action( 'customize_register', 'newspack_tec_customize_register' ); 41 | 42 | /** 43 | * Show sidebar on this page 44 | */ 45 | function newspack_tec_show_sidebar() { 46 | $show_sidebar = false; 47 | if ( function_exists( 'tribe_is_event' ) && tribe_is_event() && is_single() && true === get_theme_mod( 'newspack_tec_sidebar_single', false ) ) { 48 | $show_sidebar = true; 49 | } 50 | 51 | return $show_sidebar; 52 | } 53 | 54 | /** 55 | * Add CSS Class when sidebar is enabled. 56 | * 57 | * @param array $classes Classes for the body element. 58 | * @return array 59 | */ 60 | function newspack_tec_body_classes( $classes ) { 61 | if ( newspack_tec_show_sidebar() ) : 62 | $classes[] = 'tec-sidebar'; 63 | endif; 64 | return $classes; 65 | } 66 | add_filter( 'body_class', 'newspack_tec_body_classes' ); 67 | -------------------------------------------------------------------------------- /newspack-theme/inc/web-stories.php: -------------------------------------------------------------------------------- 1 | get_key() ) { 26 | return $contact_methods; 27 | } 28 | } 29 | $contact_methods[] = new Newspack_Theme_Bluesky(); 30 | return $contact_methods; 31 | } 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /newspack-theme/index.php: -------------------------------------------------------------------------------- 1 | 17 | 18 |
19 |
20 | 21 | 40 | 41 |
42 | 43 |
44 | 45 | { 28 | this.setState( { value } ); 29 | updateFeaturedImagePosition( value, meta ); 30 | } } 31 | /> 32 | ); 33 | } 34 | } 35 | 36 | const ComposedRadio = compose( [ 37 | withSelect( _select => { 38 | const { getCurrentPostAttribute, getEditedPostAttribute } = _select( 'core/editor' ); 39 | return { 40 | meta: { ...getCurrentPostAttribute( 'meta' ), ...getEditedPostAttribute( 'meta' ) }, 41 | }; 42 | } ), 43 | withDispatch( dispatch => ( { 44 | updateFeaturedImagePosition( value, meta ) { 45 | meta = { 46 | ...meta, 47 | newspack_featured_image_position: value, 48 | }; 49 | dispatch( 'core/editor' ).editPost( { meta } ); 50 | }, 51 | } ) ), 52 | ] )( RadioCustom ); 53 | 54 | const wrapPostFeaturedImage = OriginalComponent => { 55 | // eslint-disable-next-line react/display-name 56 | return props => { 57 | const post_type = select( 'core/editor' ).getCurrentPostType(); 58 | 59 | // eslint-disable-next-line no-undef 60 | if ( ! newspack_theme_featured_image_post_types.includes( post_type ) ) { 61 | return ; 62 | } 63 | 64 | return ( 65 | 66 | 67 | 68 | 69 | ); 70 | }; 71 | }; 72 | 73 | addFilter( 74 | 'editor.PostFeaturedImage', 75 | 'enhance-featured-image/featured-image-position-control', 76 | wrapPostFeaturedImage 77 | ); 78 | -------------------------------------------------------------------------------- /newspack-theme/js/src/font-loading.js: -------------------------------------------------------------------------------- 1 | const fontsToLoad = window.newspackFontLoading?.fonts || []; 2 | Promise.all( 3 | fontsToLoad.map(fontName => document.fonts.load(`1rem ${fontName}`)) 4 | ).then(res => { 5 | if (res.length === fontsToLoad.length) { 6 | document.body.classList.remove('newspack--font-loading'); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /newspack-theme/js/src/logo-customize-controls.js: -------------------------------------------------------------------------------- 1 | /* globals jQuery */ 2 | 3 | /** 4 | * File customize-controls.js. 5 | * 6 | * Brings logo resizing technology to the Customizer. 7 | * 8 | * Contains handlers to change Customizer controls. 9 | */ 10 | ( function ( $ ) { 11 | 'use strict'; 12 | 13 | const api = wp.customize; 14 | 15 | api.bind( 'ready', function () { 16 | $( window ).load( function () { 17 | if ( false === api.control( 'custom_logo' ).setting() ) { 18 | $( '#customize-control-logo_size' ).hide(); 19 | } 20 | } ); 21 | } ); 22 | 23 | // Check logo changes 24 | api( 'custom_logo', function ( value ) { 25 | value.bind( function ( to ) { 26 | if ( '' === to ) { 27 | api.control( 'logo_size' ).deactivate(); 28 | } else { 29 | $( '#customize-control-logo_size' ).show(); 30 | api.control( 'logo_size' ).activate(); 31 | api.control( 'logo_size' ).setting( 50 ); 32 | api.control( 'logo_size' ).setting.preview(); 33 | } 34 | } ); 35 | } ); 36 | } )( jQuery ); 37 | -------------------------------------------------------------------------------- /newspack-theme/js/src/menu-accessibility.js: -------------------------------------------------------------------------------- 1 | /* globals newspackScreenReaderText */ 2 | 3 | /** 4 | * File amp-fallback.js. 5 | * 6 | * AMP fallback JavaScript. 7 | */ 8 | 9 | ( function () { 10 | function updateMenu() { 11 | // Get dropdown menu toggles in the header. 12 | const headerContain = document.getElementById( 'masthead' ); 13 | if ( headerContain ) { 14 | const dropdownToggle = headerContain.getElementsByClassName( 'submenu-expand' ); 15 | 16 | // Loop through each dropdown menu toggle. 17 | if ( 0 < dropdownToggle.length ) { 18 | for ( let i = 0; i < dropdownToggle.length; i++ ) { 19 | const parentMenuID = dropdownToggle[ i ].getAttribute( 'data-toggle-parent-id' ), 20 | subMenu = dropdownToggle[ i ].nextElementSibling, 21 | subMenuId = parentMenuID.replace( 'toggle-', 'submenu-' ); 22 | 23 | // Give each submenu an ID based on their parent item ID. 24 | subMenu.setAttribute( 'id', subMenuId ); 25 | // Give each dropdown toggle an aria-controls attribute that matches the submenu ID. 26 | dropdownToggle[ i ].setAttribute( 'aria-controls', subMenuId ); 27 | } 28 | } 29 | } 30 | } 31 | 32 | // If AMP is on, we need to hold off running this JavaScript until we're sure the menus are in their right spots: 33 | if ( newspackScreenReaderText.is_amp ) { 34 | const primaryMenu = document.getElementById( 'site-navigation' ), 35 | secondaryMenu = document.getElementById( 'secondary-nav-contain' ), 36 | config = { childList: true }; 37 | 38 | // Callback function to execute when mutations are observed. 39 | const callback = mutationList => { 40 | for ( const mutation of mutationList ) { 41 | if ( mutation.type === 'childList' ) { 42 | updateMenu(); 43 | 44 | // Stop observing 45 | observer.disconnect(); 46 | } 47 | } 48 | }; 49 | 50 | // Create an observer instance linked to the callback function 51 | const observer = new MutationObserver( callback ); 52 | 53 | // Start observing the target node for configured mutations 54 | if ( primaryMenu ) { 55 | observer.observe( primaryMenu, config ); 56 | } 57 | if ( secondaryMenu ) { 58 | observer.observe( secondaryMenu, config ); 59 | } 60 | } else { 61 | updateMenu(); 62 | } 63 | } )(); 64 | -------------------------------------------------------------------------------- /newspack-theme/js/src/post-subtitle/SubtitleEditor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress dependencies 3 | */ 4 | import { compose } from '@wordpress/compose'; 5 | import { withDispatch } from '@wordpress/data'; 6 | import { useState, useEffect } from '@wordpress/element'; 7 | import { TextareaControl } from '@wordpress/components'; 8 | 9 | /** 10 | * Internal dependencies 11 | */ 12 | import { connectWithSelect, META_FIELD_NAME } from './utils'; 13 | 14 | const decorate = compose( 15 | connectWithSelect, 16 | withDispatch( dispatch => ( { 17 | saveSubtitle: subtitle => { 18 | dispatch( 'core/editor' ).editPost( { 19 | meta: { 20 | [ META_FIELD_NAME ]: subtitle, 21 | }, 22 | } ); 23 | }, 24 | } ) ) 25 | ); 26 | 27 | const SubtitleEditor = ( { subtitle, saveSubtitle } ) => { 28 | const [ value, setValue ] = useState( subtitle ); 29 | 30 | useEffect( () => { 31 | saveSubtitle( value ); 32 | }, [ value ] ); 33 | 34 | return ( 35 | 40 | ); 41 | }; 42 | 43 | export default decorate( SubtitleEditor ); 44 | -------------------------------------------------------------------------------- /newspack-theme/js/src/post-subtitle/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * WordPress dependencies 5 | */ 6 | import { registerPlugin } from '@wordpress/plugins'; 7 | import { PluginDocumentSettingPanel } from '@wordpress/edit-post'; 8 | import { useEffect } from '@wordpress/element'; 9 | import { __ } from '@wordpress/i18n'; 10 | 11 | /** 12 | * Internal dependencies 13 | */ 14 | import SubtitleEditor from './SubtitleEditor'; 15 | import { appendSubtitleToTitleDOMElement, connectWithSelect } from './utils'; 16 | 17 | /** 18 | * Component to be used as a panel in the Document tab of the Editor. 19 | * 20 | * https://developer.wordpress.org/block-editor/developers/slotfills/plugin-document-setting-panel/ 21 | */ 22 | const NewspackSubtitlePanel = ( { subtitle } ) => { 23 | // Update the DOM when subtitle value changes. 24 | useEffect( () => { 25 | appendSubtitleToTitleDOMElement( subtitle ); 26 | }, [ subtitle ] ); 27 | 28 | return ( 29 | 34 | { __( 'Set a Subtitle for the Article', 'newspack' ) } 35 | 36 | 37 | ); 38 | }; 39 | 40 | registerPlugin( 'plugin-document-setting-panel-newspack-subtitle', { 41 | render: connectWithSelect( NewspackSubtitlePanel ), 42 | icon: null, 43 | } ); 44 | -------------------------------------------------------------------------------- /newspack-theme/js/src/post-subtitle/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress dependencies 3 | */ 4 | import { withSelect } from '@wordpress/data'; 5 | 6 | const SUBTITLE_ID = 'newspack-post-subtitle-element'; 7 | export const META_FIELD_NAME = 'newspack_post_subtitle'; 8 | 9 | /** 10 | * Appends subtitle to DOM, below the Title in the Editor. 11 | * 12 | * @param {string} subtitle Subtitle text 13 | */ 14 | export const appendSubtitleToTitleDOMElement = subtitle => { 15 | const titleEl = document.querySelector( '.edit-post-visual-editor__post-title-wrapper' ); 16 | 17 | if ( titleEl && typeof subtitle === 'string' ) { 18 | let subtitleEl = document.getElementById( SUBTITLE_ID ); 19 | const titleParent = titleEl.parentNode; 20 | if ( ! subtitleEl ) { 21 | subtitleEl = document.createElement( 'div' ); 22 | subtitleEl.id = SUBTITLE_ID; 23 | titleParent.insertBefore( subtitleEl, titleEl.nextSibling ); 24 | } 25 | subtitleEl.innerHTML = subtitle; 26 | } 27 | }; 28 | 29 | export const connectWithSelect = withSelect( select => ( { 30 | subtitle: select( 'core/editor' ).getEditedPostAttribute( 'meta' )[ META_FIELD_NAME ], 31 | } ) ); 32 | -------------------------------------------------------------------------------- /newspack-theme/js/src/post-summary/SummaryEditor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress dependencies 3 | */ 4 | import { compose } from '@wordpress/compose'; 5 | import { withDispatch } from '@wordpress/data'; 6 | import { useState, useEffect } from '@wordpress/element'; 7 | import { TextareaControl } from '@wordpress/components'; 8 | import { __ } from '@wordpress/i18n'; 9 | 10 | /** 11 | * Internal dependencies 12 | */ 13 | import { connectWithSelect, META_FIELD_SUMMARY } from './utils'; 14 | 15 | const decorateSummary = compose( 16 | connectWithSelect, 17 | withDispatch( dispatch => ( { 18 | saveSummary: summary => { 19 | dispatch( 'core/editor' ).editPost( { 20 | meta: { 21 | [ META_FIELD_SUMMARY ]: summary, 22 | }, 23 | } ); 24 | }, 25 | } ) ) 26 | ); 27 | 28 | const SummaryEditor = ( { summary, saveSummary } ) => { 29 | const [ value, setValue ] = useState( summary ); 30 | 31 | useEffect( () => { 32 | saveSummary( value ); 33 | }, [ value ] ); 34 | 35 | return ( 36 | 42 | ); 43 | }; 44 | 45 | export default decorateSummary( SummaryEditor ); 46 | -------------------------------------------------------------------------------- /newspack-theme/js/src/post-summary/SummaryTitleEditor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress dependencies 3 | */ 4 | import { compose } from '@wordpress/compose'; 5 | import { withDispatch } from '@wordpress/data'; 6 | import { useState, useEffect } from '@wordpress/element'; 7 | import { TextControl } from '@wordpress/components'; 8 | import { __ } from '@wordpress/i18n'; 9 | 10 | /** 11 | * Internal dependencies 12 | */ 13 | import { connectWithSelect, META_FIELD_TITLE } from './utils'; 14 | 15 | const decorateTitle = compose( 16 | connectWithSelect, 17 | withDispatch( dispatch => ( { 18 | saveSummaryTitle: summaryTitle => { 19 | dispatch( 'core/editor' ).editPost( { 20 | meta: { 21 | [ META_FIELD_TITLE ]: summaryTitle, 22 | }, 23 | } ); 24 | }, 25 | } ) ) 26 | ); 27 | 28 | const SummaryTitleEditor = ( { summaryTitle, saveSummaryTitle } ) => { 29 | const [ value, setValue ] = useState( summaryTitle ); 30 | 31 | useEffect( () => { 32 | saveSummaryTitle( value ); 33 | }, [ value ] ); 34 | 35 | return ( 36 | 42 | ); 43 | }; 44 | 45 | export default decorateTitle( SummaryTitleEditor ); 46 | -------------------------------------------------------------------------------- /newspack-theme/js/src/post-summary/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * WordPress dependencies 5 | */ 6 | import { registerPlugin } from '@wordpress/plugins'; 7 | import { PluginDocumentSettingPanel } from '@wordpress/edit-post'; 8 | import { __ } from '@wordpress/i18n'; 9 | 10 | /** 11 | * Internal dependencies 12 | */ 13 | import SummaryEditor from './SummaryEditor'; 14 | import SummaryTitleEditor from './SummaryTitleEditor'; 15 | import { connectWithSelect } from './utils'; 16 | 17 | /** 18 | * Component to be used as a panel in the Document tab of the Editor. 19 | * 20 | * https://developer.wordpress.org/block-editor/developers/slotfills/plugin-document-setting-panel/ 21 | */ 22 | const NewspackSummaryPanel = () => { 23 | return ( 24 | 29 |

30 | { __( 31 | 'Write a summary that will be appended to the top of the article content.', 32 | 'newspack' 33 | ) } 34 |

35 | 36 | 37 |
38 | ); 39 | }; 40 | 41 | registerPlugin( 'plugin-document-setting-panel-newspack-summary', { 42 | render: connectWithSelect( NewspackSummaryPanel ), 43 | icon: null, 44 | } ); 45 | -------------------------------------------------------------------------------- /newspack-theme/js/src/post-summary/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress dependencies 3 | */ 4 | import { withSelect } from '@wordpress/data'; 5 | 6 | export const META_FIELD_SUMMARY = 'newspack_article_summary'; 7 | export const META_FIELD_TITLE = 'newspack_article_summary_title'; 8 | 9 | export const connectWithSelect = withSelect( select => ( { 10 | summary: select( 'core/editor' ).getEditedPostAttribute( 'meta' )[ META_FIELD_SUMMARY ], 11 | summaryTitle: select( 'core/editor' ).getEditedPostAttribute( 'meta' )[ META_FIELD_TITLE ], 12 | mode: select( 'core/edit-post' ).getEditorMode(), 13 | } ) ); 14 | -------------------------------------------------------------------------------- /newspack-theme/js/src/relative-time.js: -------------------------------------------------------------------------------- 1 | /* globals newspack_relative_time */ 2 | document.addEventListener('DOMContentLoaded', () => { 3 | 4 | /** 5 | * Calculate the time difference and return the value and unit. 6 | * 7 | * Eg. 3 day, 1 year ago, etc. 8 | * @param {number} time_diff - The time difference in seconds 9 | * @return {{value: number, unit: string}} Object with value and unit 10 | */ 11 | const time_ago = (time_diff) => { 12 | const abs_time_diff = Math.abs(time_diff); 13 | let unit, value; 14 | 15 | if (abs_time_diff < 60) { 16 | unit = 'second'; 17 | value = time_diff; 18 | } else if (abs_time_diff < 3600) { 19 | unit = 'minute'; 20 | value = time_diff / 60; 21 | } else if (abs_time_diff < 86400) { 22 | unit = 'hour'; 23 | value = time_diff / 3600; 24 | } else if (abs_time_diff < 2592000) { 25 | unit = 'day'; 26 | value = time_diff / 86400; 27 | } else if (abs_time_diff < 31536000) { 28 | unit = 'month'; 29 | value = time_diff / 2592000; 30 | } else { 31 | unit = 'year'; 32 | value = time_diff / 31536000; 33 | } 34 | 35 | return {value: Math.floor(value), unit}; 36 | }; 37 | 38 | const entry_dates = document.querySelectorAll( 39 | 'time.entry-date, .comment-meta time' 40 | ); 41 | if (entry_dates.length < 1) { 42 | return; 43 | } 44 | const locale = newspack_relative_time.language_tag || 'en-US'; 45 | const cutoff_in_days = parseInt(newspack_relative_time.cutoff, 10) || 14; 46 | const cutoff = cutoff_in_days * 60 * 60 * 24; 47 | 48 | const rtf = new Intl.RelativeTimeFormat(locale, { 49 | numeric: 'auto', 50 | style: 'long', 51 | }); 52 | 53 | const now = new Date(); 54 | 55 | entry_dates.forEach(time_element => { 56 | // Get the datetime attribute value 57 | const datetime = time_element.getAttribute('datetime'); 58 | if (!datetime) { 59 | return; 60 | } 61 | 62 | const date = new Date(datetime); 63 | 64 | if (isNaN(date.getTime())) { 65 | return; 66 | } 67 | 68 | const time_diff = Math.floor((date - now) / 1000); 69 | if (Math.abs(time_diff) > cutoff) { 70 | // If the cutoff is reached, leave the date alone. 71 | return; 72 | } 73 | 74 | const {value, unit} = time_ago(time_diff); 75 | 76 | // Update the element's text content 77 | time_element.textContent = rtf.format(value, unit); 78 | 79 | // Add a title attribute with the original date on hover. 80 | if (!time_element.title) { 81 | time_element.title = date.toLocaleString(locale); 82 | } 83 | }); 84 | }); 85 | -------------------------------------------------------------------------------- /newspack-theme/languages/de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-theme/languages/de_DE.mo -------------------------------------------------------------------------------- /newspack-theme/languages/es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-theme/languages/es_ES.mo -------------------------------------------------------------------------------- /newspack-theme/languages/fr_BE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-theme/languages/fr_BE.mo -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-de_DE-1214ebc007983574185a9f0914311f01.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:09-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-meta-toggles.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de","plural-forms":"nplurals=2; plural=(n != 1);"},"Hide last updated date":[""],"Show last updated date":[""],"Hide page title":[""],"Show Jetpack share buttons":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-de_DE-5fc520bf9874d4f5fca37c405ec1d21a.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:09-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-subtitle.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de","plural-forms":"nplurals=2; plural=(n != 1);"},"Article Subtitle":[""],"Set a Subtitle for the Article":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-de_DE-833a9c337dfe3a093d473e3fc210e521.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:09-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/extend-featured-image-editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de","plural-forms":"nplurals=2; plural=(n != 1);"},"Small":["Klein"],"Large":["Gro\u00df"],"Behind article title":[""],"Beside article title":[""],"Above article title":[""],"Hidden":["Verborgen"],"Default (set in Customizer)":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-de_DE-df181a26eb62f21273525d59fc065434.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:09-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-summary.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de","plural-forms":"nplurals=2; plural=(n != 1);"},"Body:":[""],"Title:":[""],"Article Summary":[""],"Write a summary that will be appended to the top of the article content.":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-es_ES-1214ebc007983574185a9f0914311f01.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:10-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-meta-toggles.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es_ES","plural-forms":"nplurals=2; plural=(n != 1);"},"Hide last updated date":[""],"Show last updated date":[""],"Hide page title":[""],"Show Jetpack share buttons":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-es_ES-5fc520bf9874d4f5fca37c405ec1d21a.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:10-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-subtitle.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es_ES","plural-forms":"nplurals=2; plural=(n != 1);"},"Article Subtitle":[""],"Set a Subtitle for the Article":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-es_ES-833a9c337dfe3a093d473e3fc210e521.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:10-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/extend-featured-image-editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es_ES","plural-forms":"nplurals=2; plural=(n != 1);"},"Small":["Peque\u00f1o"],"Large":["Grande"],"Behind article title":[""],"Beside article title":[""],"Above article title":[""],"Hidden":[""],"Default (set in Customizer)":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-es_ES-df181a26eb62f21273525d59fc065434.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:10-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-summary.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"es_ES","plural-forms":"nplurals=2; plural=(n != 1);"},"Body:":[""],"Title:":[""],"Article Summary":[""],"Write a summary that will be appended to the top of the article content.":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-fr_BE-1214ebc007983574185a9f0914311f01.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:11-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-meta-toggles.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_BE","plural-forms":"nplurals=2; plural=(n > 1);"},"Hide last updated date":[""],"Show last updated date":[""],"Hide page title":[""],"Show Jetpack share buttons":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-fr_BE-5fc520bf9874d4f5fca37c405ec1d21a.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:11-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-subtitle.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_BE","plural-forms":"nplurals=2; plural=(n > 1);"},"Article Subtitle":["Sous-titre de l\u2019article"],"Set a Subtitle for the Article":["D\u00e9finir un sous-titre pour l\u2019article"]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-fr_BE-833a9c337dfe3a093d473e3fc210e521.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:11-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/extend-featured-image-editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_BE","plural-forms":"nplurals=2; plural=(n > 1);"},"Small":["Petit"],"Large":["Large"],"Behind article title":["Derri\u00e8re le titre de l\u2019article"],"Beside article title":["\u00c0 c\u00f4t\u00e9 du titre de l\u2019article"],"Above article title":[""],"Hidden":["Masqu\u00e9"],"Default (set in Customizer)":["Par d\u00e9faut (d\u00e9fini dans le personnalisateur)"]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-fr_BE-df181a26eb62f21273525d59fc065434.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:11-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-summary.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fr_BE","plural-forms":"nplurals=2; plural=(n > 1);"},"Body:":[""],"Title:":[""],"Article Summary":[""],"Write a summary that will be appended to the top of the article content.":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pl_PL-1214ebc007983574185a9f0914311f01.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:12-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-meta-toggles.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"Hide last updated date":[""],"Show last updated date":["Poka\u017c dat\u0119 ostatniej aktualizacji w pojedynczych artyku\u0142ach"],"Hide page title":[""],"Show Jetpack share buttons":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pl_PL-5fc520bf9874d4f5fca37c405ec1d21a.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:12-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-subtitle.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"Article Subtitle":[""],"Set a Subtitle for the Article":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pl_PL-833a9c337dfe3a093d473e3fc210e521.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:12-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/extend-featured-image-editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"Small":["Ma\u0142y"],"Large":["Du\u017cy"],"Behind article title":["Za tytu\u0142em artyku\u0142u"],"Beside article title":["Obok tytu\u0142u artyku\u0142u"],"Above article title":["Powy\u017cej tytu\u0142 artyku\u0142u"],"Hidden":["Ukryty"],"Default (set in Customizer)":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pl_PL-df181a26eb62f21273525d59fc065434.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:12-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-summary.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"Body:":[""],"Title:":[""],"Article Summary":[""],"Write a summary that will be appended to the top of the article content.":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pt_BR-1214ebc007983574185a9f0914311f01.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-14 10:02-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-meta-toggles.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt_BR","plural-forms":"nplurals=2; plural=n != 1;"},"Hide last updated date":[""],"Show last updated date":[""],"Hide page title":[""],"Show Jetpack share buttons":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pt_BR-5fc520bf9874d4f5fca37c405ec1d21a.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-14 10:02-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-subtitle.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt_BR","plural-forms":"nplurals=2; plural=n != 1;"},"Article Subtitle":[""],"Set a Subtitle for the Article":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pt_BR-833a9c337dfe3a093d473e3fc210e521.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-14 10:02-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/extend-featured-image-editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt_BR","plural-forms":"nplurals=2; plural=n != 1;"},"Small":["Pequeno"],"Large":["Amplo"],"Behind article title":[""],"Beside article title":[""],"Above article title":[""],"Hidden":[""],"Default (set in Customizer)":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pt_BR-df181a26eb62f21273525d59fc065434.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-14 10:02-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-summary.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt_BR","plural-forms":"nplurals=2; plural=n != 1;"},"Body:":[""],"Title:":[""],"Article Summary":[""],"Write a summary that will be appended to the top of the article content.":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pt_PT-1214ebc007983574185a9f0914311f01.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:13-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-meta-toggles.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt","plural-forms":"nplurals=2; plural=(n > 1);"},"Hide last updated date":[""],"Show last updated date":[""],"Hide page title":[""],"Show Jetpack share buttons":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pt_PT-5fc520bf9874d4f5fca37c405ec1d21a.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:13-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-subtitle.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt","plural-forms":"nplurals=2; plural=(n > 1);"},"Article Subtitle":[""],"Set a Subtitle for the Article":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pt_PT-833a9c337dfe3a093d473e3fc210e521.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:13-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/extend-featured-image-editor.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt","plural-forms":"nplurals=2; plural=(n > 1);"},"Small":["Pequeno"],"Large":["Amplo"],"Behind article title":[""],"Beside article title":[""],"Above article title":[""],"Hidden":["Escondido"],"Default (set in Customizer)":["Padr\u00e3o (definido em Personalizar)"]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/newspack-pt_PT-df181a26eb62f21273525d59fc065434.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2025-03-12 09:13-0700","generator":"WP-CLI\/2.8.1","source":"js\/dist\/post-summary.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pt","plural-forms":"nplurals=2; plural=(n > 1);"},"Body:":[""],"Title:":[""],"Article Summary":[""],"Write a summary that will be appended to the top of the article content.":[""]}}} -------------------------------------------------------------------------------- /newspack-theme/languages/pl_PL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-theme/languages/pl_PL.mo -------------------------------------------------------------------------------- /newspack-theme/languages/pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-theme/languages/pt_BR.mo -------------------------------------------------------------------------------- /newspack-theme/languages/pt_PT.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-theme/languages/pt_PT.mo -------------------------------------------------------------------------------- /newspack-theme/no-header-footer.php: -------------------------------------------------------------------------------- 1 | 11 | > 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | data-amp-auto-lightbox-disable> 20 | 21 | 22 |
23 | 24 | 25 |
26 | 27 |
28 |
29 | 40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 60 |
61 | 62 | 63 | 64 |
65 |
66 | 67 |
68 | 69 |
70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /newspack-theme/offline.php: -------------------------------------------------------------------------------- 1 | 25 |
26 |
27 |

28 |
29 |
30 | 35 |
36 |
37 | 12 | 13 |
14 |
15 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | 33 |
34 | 48 |
49 | 50 | 54 | 55 |
56 |
57 | 58 | p { 47 | margin: 0 0 structure.$size__spacing-unit; 48 | } 49 | 50 | cite { 51 | color: var(--newspack-theme-color-text-light); 52 | } 53 | } 54 | 55 | @include meta.load-css( "tables" ); 56 | -------------------------------------------------------------------------------- /newspack-theme/sass/elements/_lists.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | ul, 4 | ol { 5 | padding-left: structure.$size__spacing-unit; 6 | } 7 | 8 | ul { 9 | list-style: disc; 10 | 11 | ul { 12 | list-style-type: circle; 13 | } 14 | 15 | &.is-style-checked { 16 | list-style-type: none; 17 | padding-left: calc(24px + 0.25em); 18 | 19 | li { 20 | position: relative; 21 | 22 | &::before { 23 | background: currentcolor; 24 | clip-path: polygon(69.5833% 29.5834%, 43.3333% 65%, 29.5833% 54.5834%, 25.8333% 59.5834%, 44.5833% 73.75%, 74.5833% 33.3334%, 69.5833% 29.5834%); 25 | content: ""; 26 | display: block; 27 | height: 24px; 28 | left: calc(-24px - 0.25em); 29 | position: absolute; 30 | top: calc(( 1em * var(--newspack-theme-font-line-height-body) - 24px ) / 2); 31 | width: 24px; 32 | } 33 | } 34 | } 35 | } 36 | 37 | ol { 38 | list-style: decimal; 39 | } 40 | 41 | li { 42 | line-height: var(--newspack-theme-font-line-height-body); 43 | } 44 | 45 | li > ul, 46 | li > ol { 47 | padding-left: ( 2 * structure.$size__spacing-unit ); 48 | } 49 | 50 | dt { 51 | font-weight: bold; 52 | } 53 | 54 | dd { 55 | margin: 0 structure.$size__spacing-unit structure.$size__spacing-unit; 56 | } 57 | -------------------------------------------------------------------------------- /newspack-theme/sass/elements/_tables.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | table { 4 | margin: 0 0 structure.$size__spacing-unit; 5 | border-collapse: collapse; 6 | width: 100%; 7 | font-size: var(--newspack-theme-font-size-sm); 8 | 9 | td, 10 | th { 11 | padding: 0.5em; 12 | border: 1px solid var(--newspack-theme-color-text-light); 13 | word-break: break-all; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /newspack-theme/sass/forms/_amp.scss: -------------------------------------------------------------------------------- 1 | .amp-wp-default-form-message { 2 | p { 3 | font-size: var(--newspack-theme-font-size-sm); 4 | font-weight: bold; 5 | } 6 | small { 7 | font-size: inherit; 8 | font-weight: normal; 9 | } 10 | 11 | &[submit-success] > p:not(.amp-wp-form-redirecting) { 12 | border-color: #84c46e; 13 | background: #a1e789; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /newspack-theme/sass/forms/_buttons.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | @use "../mixins/utilities"; 3 | 4 | .button, 5 | button, 6 | input[type="button"], 7 | input[type="reset"], 8 | input[type="submit"], 9 | .wp-block-search__button { 10 | @include utilities.button-transition; 11 | 12 | background-color: var(--newspack-theme-color-secondary); 13 | border: none; 14 | border-radius: 5px; 15 | box-sizing: border-box; 16 | display: inline-block; 17 | color: var(--newspack-theme-color-against-secondary); 18 | font-family: var(--newspack-theme-font-heading); 19 | font-size: var(--newspack-theme-font-size-sm); 20 | font-weight: 700; 21 | line-height: var(--newspack-theme-font-line-height-heading); 22 | outline: none; 23 | padding: ( structure.$size__spacing-unit * 0.76 ) structure.$size__spacing-unit; 24 | text-decoration: none; 25 | vertical-align: bottom; 26 | 27 | &:hover, 28 | &:hover:visited { 29 | background-color: var(--newspack-theme-color-bg-button-hover); 30 | color: var(--newspack-theme-color-bg-body); 31 | cursor: pointer; 32 | } 33 | 34 | &:visited { 35 | color: inherit; 36 | text-decoration: none; 37 | } 38 | 39 | &:focus { 40 | background-color: var(--newspack-theme-color-bg-button-hover); 41 | color: var(--newspack-theme-color-bg-body); 42 | outline: thin dotted; 43 | outline-offset: -4px; 44 | } 45 | 46 | &[disabled], 47 | &[disabled]:hover { 48 | background-color: var(--newspack-ui-color-neutral-30, #ddd); 49 | color: var(--newspack-ui-color-neutral-0, #fff); 50 | cursor: default; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /newspack-theme/sass/forms/_fields.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | input[type="text"], 4 | input[type="email"], 5 | input[type="url"], 6 | input[type="password"], 7 | input[type="search"], 8 | input[type="number"], 9 | input[type="tel"], 10 | input[type="range"], 11 | input[type="date"], 12 | input[type="month"], 13 | input[type="week"], 14 | input[type="time"], 15 | input[type="datetime"], 16 | input[type="datetime-local"], 17 | input[type="zip"], 18 | input[type="color"], 19 | textarea { 20 | backface-visibility: hidden; 21 | background: var(--newspack-theme-color-bg-input); 22 | border: solid 1px var(--newspack-theme-color-border); 23 | box-sizing: border-box; 24 | outline: none; 25 | padding: #{0.36 * structure.$size__spacing-unit} #{0.66 * structure.$size__spacing-unit}; 26 | appearance: none; 27 | outline-offset: 0; 28 | border-radius: 0; 29 | 30 | &:focus { 31 | border-color: var(--newspack-theme-color-text-main); 32 | outline: thin solid rgb(var(--newspack-theme-color-text-main), 0.25); 33 | outline-offset: -4px; 34 | } 35 | } 36 | 37 | input[type="search"] { 38 | &::-webkit-search-decoration { 39 | display: none; 40 | } 41 | } 42 | 43 | textarea { 44 | box-sizing: border-box; 45 | display: block; 46 | width: 100%; 47 | max-width: 100%; 48 | resize: vertical; 49 | } 50 | 51 | form { 52 | p { 53 | margin: structure.$size__spacing-unit 0; 54 | } 55 | } 56 | 57 | input[type="checkbox"] { 58 | appearance: none; 59 | background: white; 60 | border: solid 1px var(--newspack-theme-color-border); 61 | border-radius: 2px; 62 | color: var(--newspack-theme-color-against-secondary); 63 | cursor: pointer; 64 | display: inline-grid; 65 | font: inherit; 66 | height: 20px !important; 67 | margin: 0; 68 | place-content: center; 69 | width: 20px !important; 70 | 71 | &::before { 72 | background: 73 | transparent 74 | url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath d='M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z' fill='white' %3E%3C/path%3E%3C/svg%3E") 75 | 0 0 no-repeat; 76 | content: ""; 77 | display: block; 78 | height: 24px; 79 | opacity: 0; 80 | width: 24px; 81 | } 82 | 83 | &:checked { 84 | background: var(--newspack-theme-color-secondary); 85 | border-color: transparent; 86 | 87 | &::before { 88 | opacity: 1; 89 | } 90 | } 91 | 92 | &:focus { 93 | outline: 1.5px solid var(--newspack-theme-color-secondary); 94 | outline-offset: 1px; 95 | } 96 | 97 | &:disabled { 98 | cursor: not-allowed; 99 | opacity: 0.75; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /newspack-theme/sass/forms/_forms.scss: -------------------------------------------------------------------------------- 1 | @use "buttons"; 2 | 3 | @use "fields"; 4 | 5 | @use "search"; 6 | 7 | @use "amp"; 8 | -------------------------------------------------------------------------------- /newspack-theme/sass/forms/_search.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | .search-form { 4 | position: relative; 5 | 6 | input { 7 | padding-right: #{2.5 * structure.$size__spacing-unit}; 8 | width: 100%; 9 | } 10 | 11 | button { 12 | background-color: transparent; 13 | bottom: 2px; 14 | color: var(--newspack-theme-color-text-main); 15 | position: absolute; 16 | margin: 0; 17 | padding: 0 #{0.5 * structure.$size__spacing-unit}; 18 | right: 2px; 19 | top: 2px; 20 | 21 | svg { 22 | position: relative; 23 | top: 2px; 24 | } 25 | 26 | &:active, 27 | &:hover, 28 | &:focus { 29 | color: var(--newspack-theme-color-primary-against-white); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /newspack-theme/sass/media/_captions.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | .wp-caption { 4 | margin-bottom: calc(1.5 * #{structure.$size__spacing-unit}); 5 | } 6 | 7 | .wp-caption img[class*="wp-image-"] { 8 | display: block; 9 | margin-left: auto; 10 | margin-right: auto; 11 | } 12 | 13 | figcaption, 14 | .wp-caption-text, 15 | .swiper-pagination-simple { 16 | color: var(--newspack-theme-color-text-light); 17 | margin: 0 auto; 18 | padding: 0; 19 | text-align: left; 20 | } 21 | 22 | // Override some specific styles coming from WordPress. 23 | :root :where(.wp-block-image figcaption) { 24 | color: var(--newspack-theme-color-text-light); 25 | font-size: var(--newspack-theme-font-size-xs); 26 | } 27 | 28 | .has-text-color { 29 | figcaption, 30 | .wp-caption-text { 31 | color: inherit; 32 | } 33 | } 34 | 35 | figcaption, 36 | .wp-caption-text, 37 | .amp-image-lightbox-caption, 38 | .swiper-pagination-simple { 39 | font-size: var(--newspack-theme-font-size-xs); 40 | font-family: var(--newspack-theme-font-heading); 41 | line-height: var(--newspack-theme-font-line-height-body); 42 | } 43 | 44 | /* Hack to address a bug that affects caption positioning in Safari only. Targets Safari 9+ only. */ 45 | @supports ( -webkit-hyphens: none ) { 46 | .wp-block-image [class^="align"] > figcaption { 47 | display: block; 48 | } 49 | } 50 | 51 | .entry-content { 52 | .wp-caption-text, 53 | figcaption { 54 | max-width: 780px; 55 | } 56 | 57 | .alignfull, 58 | .alignwide { 59 | > figcaption { 60 | width: min(90vw, 780px); 61 | } 62 | } 63 | 64 | .wp-block-column { 65 | figcaption, 66 | .alignfull > figcaption, 67 | .alignwide > figcaption { 68 | max-width: 100%; 69 | width: 100%; 70 | } 71 | } 72 | } 73 | 74 | .newspack-front-page, 75 | .post-template-single-wide, 76 | .page-template-single-wide { 77 | .entry-content { 78 | .wp-caption-text, 79 | figcaption { 80 | max-width: 1200px; 81 | } 82 | } 83 | 84 | .alignfull, 85 | .alignwide { 86 | > figcaption { 87 | width: min(90vw, 1200px); 88 | } 89 | } 90 | 91 | .entry-content .wp-block-column { 92 | figcaption, 93 | .alignfull > figcaption, 94 | .alignwide > figcaption { 95 | max-width: 100%; 96 | width: 100%; 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /newspack-theme/sass/media/_galleries.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | .gallery { 4 | display: flex; 5 | flex-flow: row wrap; 6 | justify-content: center; 7 | margin-bottom: calc(1.5 * #{structure.$size__spacing-unit}); 8 | } 9 | 10 | .gallery-item { 11 | display: inline-block; 12 | margin-right: 16px; 13 | margin-bottom: 16px; 14 | text-align: center; 15 | vertical-align: top; 16 | width: 100%; 17 | 18 | // Loops to enumerate the classes for gallery columns. 19 | @for $i from 2 through 9 { 20 | .gallery-columns-#{$i} & { 21 | max-width: calc(( 100% - 16px * #{$i - 1} ) / #{$i}); 22 | 23 | &:nth-of-type( #{$i}n + #{$i} ) { 24 | margin-right: 0; 25 | } 26 | } 27 | } 28 | 29 | &:last-of-type { 30 | padding-right: 0; 31 | } 32 | } 33 | 34 | .gallery-caption { 35 | display: block; 36 | font-family: var(--newspack-theme-font-heading); 37 | font-size: var(--newspack-theme-font-size-xs); 38 | line-height: var(--newspack-theme-font-line-height-body); 39 | margin: 0; 40 | padding: ( structure.$size__spacing-unit * 0.5 ); 41 | } 42 | 43 | .gallery-item > div > a { 44 | display: block; 45 | line-height: 0; 46 | 47 | // Accessibility 48 | box-shadow: 0 0 0 0 transparent; 49 | 50 | &:focus { 51 | box-shadow: 0 0 0 2px rgba(var(--newspack-theme-color-primary), 1); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /newspack-theme/sass/media/_media.scss: -------------------------------------------------------------------------------- 1 | @use "sass:meta"; 2 | @use "../variables-site/structure"; 3 | @use "../variables-site/transitions"; 4 | 5 | .page-content .wp-smiley, 6 | .entry-content .wp-smiley, 7 | .comment-content .wp-smiley { 8 | border: none; 9 | margin-bottom: 0; 10 | margin-top: 0; 11 | padding: 0; 12 | } 13 | 14 | embed, 15 | iframe, 16 | object { 17 | max-width: 100%; 18 | } 19 | 20 | iframe { 21 | display: block; 22 | } 23 | 24 | .custom-logo-link { 25 | display: inline-block; 26 | } 27 | 28 | .avatar { 29 | border-radius: 100%; 30 | display: block; 31 | height: calc(2.25 * #{structure.$size__spacing-unit}); 32 | min-height: inherit; 33 | width: calc(2.25 * #{structure.$size__spacing-unit}); 34 | } 35 | 36 | svg { 37 | transition: fill transitions.$icon_transition ease-in-out; 38 | fill: currentcolor; 39 | } 40 | 41 | /* -------------------------------------------------------------- 42 | ## Captions 43 | -------------------------------------------------------------- */ 44 | @include meta.load-css( "captions" ); 45 | 46 | /* -------------------------------------------------------------- 47 | ## Galleries 48 | -------------------------------------------------------------- */ 49 | @include meta.load-css( "galleries" ); 50 | -------------------------------------------------------------------------------- /newspack-theme/sass/mixins/_utilities.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | @use "../variables-site/transitions"; 3 | 4 | @mixin media( $res ) { 5 | @if mobileonly == $res { 6 | @media only screen and ( max-width: structure.$mobile_width - 1 ) { 7 | @content; 8 | } 9 | } 10 | 11 | @if mobile == $res { 12 | @media only screen and ( min-width: structure.$mobile_width ) { 13 | @content; 14 | } 15 | } 16 | 17 | @if tabletonly == $res { 18 | @media only screen and ( max-width: #{ structure.$tablet_width - 1 } ) { 19 | @content; 20 | } 21 | } 22 | 23 | @if tablet == $res { 24 | @media only screen and ( min-width: structure.$tablet_width ) { 25 | @content; 26 | } 27 | } 28 | 29 | @if narrowdesktop == $res { 30 | @media only screen and ( min-width: structure.$narrow_desktop_width ) { 31 | @content; 32 | } 33 | } 34 | 35 | @if notdesktop == $res { 36 | @media only screen and ( max-width: #{ structure.$desktop_width - 1 } ) { 37 | @content; 38 | } 39 | } 40 | 41 | @if desktop == $res { 42 | @media only screen and ( min-width: structure.$desktop_width ) { 43 | @content; 44 | } 45 | } 46 | 47 | @if wide == $res { 48 | @media only screen and ( min-width: structure.$wide_width ) { 49 | @content; 50 | } 51 | } 52 | } 53 | 54 | @mixin link-transition( $attr: color ) { 55 | transition: $attr transitions.$link_transition ease-in-out; 56 | } 57 | 58 | @mixin button-transition() { 59 | transition: background transitions.$button_transition ease-in-out; 60 | } 61 | 62 | @mixin button-all-transition() { 63 | transition: all transitions.$button_transition ease-in-out; 64 | } 65 | 66 | @mixin background-transition() { 67 | transition: background transitions.$background_transition ease-in-out; 68 | } 69 | 70 | @mixin selection { 71 | ::selection { 72 | @content; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /newspack-theme/sass/modules/_accessibility.scss: -------------------------------------------------------------------------------- 1 | @use "../mixins/mixins-main"; 2 | 3 | /* Text meant only for screen readers. */ 4 | .screen-reader-text { 5 | border: 0; 6 | clip: rect(1px, 1px, 1px, 1px); 7 | clip-path: inset(50%); 8 | height: 1px; 9 | margin: -1px; 10 | overflow: hidden; 11 | padding: 0; 12 | position: absolute !important; 13 | width: 1px; 14 | word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */ 15 | 16 | &:focus { 17 | background-color: var(--newspack-theme-color-bg-light); 18 | border-radius: 3px; 19 | box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); 20 | clip: auto !important; 21 | clip-path: none; 22 | color: var(--newspack-theme-color-text-screen); 23 | display: block; 24 | @include mixins-main.font-size( 0.875 ); 25 | 26 | font-weight: bold; 27 | height: auto; 28 | left: 5px; 29 | line-height: normal; 30 | padding: 15px 23px 14px; 31 | text-decoration: none; 32 | top: 5px; 33 | width: auto; 34 | z-index: 100000; /* Above WP toolbar. */ 35 | } 36 | } 37 | 38 | /* Do not show the outline on the skip link target. */ 39 | #content[tabindex="-1"]:focus { 40 | outline: 0; 41 | } 42 | -------------------------------------------------------------------------------- /newspack-theme/sass/modules/_alignments.scss: -------------------------------------------------------------------------------- 1 | @use "../mixins/mixins-main"; 2 | @use "../mixins/utilities"; 3 | @use "../variables-site/structure"; 4 | 5 | .alignleft { 6 | /* rtl:ignore */ 7 | float: left; 8 | /* rtl:ignore */ 9 | margin-right: structure.$size__spacing-unit; 10 | 11 | @include utilities.media( tablet ) { 12 | /* rtl:ignore */ 13 | margin-right: calc(2 * #{structure.$size__spacing-unit}); 14 | } 15 | } 16 | 17 | .alignright { 18 | /* rtl:ignore */ 19 | float: right; 20 | /* rtl:ignore */ 21 | margin-left: structure.$size__spacing-unit; 22 | 23 | @include utilities.media( tablet ) { 24 | /* rtl:ignore */ 25 | margin-left: calc(2 * #{structure.$size__spacing-unit}); 26 | } 27 | } 28 | 29 | .aligncenter { 30 | clear: both; 31 | @include mixins-main.center-block; 32 | } 33 | -------------------------------------------------------------------------------- /newspack-theme/sass/modules/_clearings.scss: -------------------------------------------------------------------------------- 1 | @use "../mixins/mixins-main"; 2 | 3 | .clear::before, 4 | .clear::after, 5 | .entry-content::before, 6 | .entry-content::after, 7 | .comment-content::before, 8 | .comment-content::after, 9 | .site-header::before, 10 | .site-header::after, 11 | .site-content::before, 12 | .site-content::after, 13 | .site-footer::before, 14 | .site-footer::after { 15 | @include mixins-main.clearfix; 16 | } 17 | 18 | .clear::after, 19 | .entry-content::after, 20 | .comment-content::after, 21 | .site-header::after, 22 | .site-content::after, 23 | .site-footer::after { 24 | @include mixins-main.clearfix-after; 25 | } 26 | -------------------------------------------------------------------------------- /newspack-theme/sass/navigation/_infinite-scroll.scss: -------------------------------------------------------------------------------- 1 | @use "../mixins/utilities"; 2 | @use "../variables-site/structure"; 3 | 4 | /* Infinite scroll */ 5 | 6 | /* Globally hidden elements when Infinite Scroll is supported and in use. */ 7 | .infinite-scroll .pagination, 8 | .infinite-scroll .posts-navigation, 9 | .infinite-scroll.neverending .site-footer { 10 | /* Theme Footer (when set to scrolling) */ 11 | display: none; 12 | } 13 | 14 | /* When Infinite Scroll has reached its end we need to re-display elements that were hidden (via .neverending) before. */ 15 | .infinity-end.neverending .site-footer { 16 | display: block; 17 | } 18 | 19 | .infinite-loader { 20 | margin: calc(3 * 1rem) auto; 21 | } 22 | 23 | .infinite-loader .spinner { 24 | margin: 0 auto; 25 | left: inherit !important; 26 | } 27 | 28 | .site-main #infinite-handle { 29 | margin: calc(2 * 1rem) auto; 30 | } 31 | 32 | .site-main #infinite-handle span { 33 | background: transparent; 34 | display: block; 35 | font-size: var(--newspack-theme-font-size-sm); 36 | text-align: center; 37 | } 38 | 39 | .site-main #infinite-handle span button, 40 | .site-main #infinite-handle span button:hover, 41 | .site-main #infinite-handle span button:focus { 42 | @include utilities.button-transition; 43 | 44 | background: var(--newspack-theme-color-secondary); 45 | color: var(--newspack-theme-color-bg-body); 46 | font-family: var(--newspack-theme-font-heading); 47 | font-weight: 700; 48 | line-height: var(--newspack-theme-font-line-height-heading); 49 | padding: ( structure.$size__spacing-unit * 0.76 ) structure.$size__spacing-unit; 50 | 51 | &:hover { 52 | background: var(--newspack-theme-color-bg-button-hover); 53 | cursor: pointer; 54 | } 55 | 56 | &:focus { 57 | background: var(--newspack-theme-color-bg-button-hover); 58 | outline: thin dotted; 59 | outline-offset: -4px; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /newspack-theme/sass/navigation/_links.scss: -------------------------------------------------------------------------------- 1 | @use "../mixins/utilities"; 2 | 3 | a { 4 | @include utilities.link-transition; 5 | 6 | color: var(--newspack-theme-color-text-light); 7 | 8 | &:visited { 9 | color: inherit; 10 | } 11 | 12 | &:hover, 13 | &:active { 14 | color: var(--newspack-theme-color-text-main); 15 | outline: 0; 16 | text-decoration: none; 17 | } 18 | 19 | &:focus { 20 | outline: thin dotted; 21 | text-decoration: underline; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /newspack-theme/sass/navigation/_menu-highlight-navigation.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | .highlight-menu-contain { 4 | margin-top: #{0.25 * structure.$size__spacing-unit}; 5 | .wrapper { 6 | font-family: var(--newspack-theme-font-heading); 7 | font-size: var(--newspack-theme-font-size-xs); 8 | height: 1.5em; 9 | overflow: hidden; 10 | word-wrap: break-word; 11 | } 12 | } 13 | 14 | .highlight-menu { 15 | ul, 16 | li { 17 | list-style: none; 18 | margin: 0; 19 | padding: 0; 20 | } 21 | 22 | ul { 23 | display: block; 24 | width: 100%; 25 | } 26 | 27 | li { 28 | display: inline-block; 29 | height: 1.5em; 30 | margin-right: #{0.5 * structure.$size__spacing-unit}; 31 | } 32 | 33 | .menu-label { 34 | color: var(--newspack-theme-color-secondary-against-white); 35 | font-weight: bold; 36 | } 37 | 38 | a, 39 | a:visited { 40 | color: var(--newspack-theme-color-text-light); 41 | } 42 | } 43 | 44 | // Header Center Logo 45 | .h-cl .site-header .highlight-menu-contain .wrapper { 46 | justify-content: center; 47 | text-align: center; 48 | } 49 | 50 | .single-featured-image-beside, 51 | .single-featured-image-behind, 52 | .single-featured-image-above { 53 | .highlight-menu-contain.desktop-only { 54 | display: none; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /newspack-theme/sass/navigation/_menu-main-navigation.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | /** === Main menu === */ 4 | 5 | .nav1 { 6 | .main-menu { 7 | > li { 8 | > a { 9 | color: inherit; 10 | padding: #{0.25 * structure.$size__spacing-unit} #{0.5 * structure.$size__spacing-unit}; 11 | font-weight: 700; 12 | 13 | &:hover { 14 | opacity: 0.75; 15 | } 16 | } 17 | } 18 | } 19 | } 20 | 21 | /* Desktop-specific styles */ 22 | .site-header { 23 | .nav1 { 24 | font-size: var(--newspack-theme-font-size-xs); 25 | 26 | .main-menu { 27 | display: inline-block; 28 | 29 | > li { 30 | color: #555; 31 | display: inline-block; 32 | line-height: 1.25; 33 | margin-right: #{0.25 * structure.$size__spacing-unit}; 34 | 35 | > a { 36 | color: inherit; 37 | } 38 | 39 | &:first-child > a { 40 | padding-left: 0; 41 | } 42 | } 43 | } 44 | } 45 | } 46 | 47 | // Header Center Logo; default height 48 | .h-cl.h-dh { 49 | .site-header { 50 | #site-navigation { 51 | flex-basis: 100%; 52 | text-align: center; 53 | 54 | ul ul { 55 | text-align: left; 56 | } 57 | } 58 | 59 | .nav1 .main-menu > li:last-child { 60 | margin-right: 0; 61 | 62 | a { 63 | padding-right: 0; 64 | } 65 | 66 | .submenu-expand { 67 | margin-right: -5px; // offset spacing next to svg icon. 68 | } 69 | } 70 | } 71 | } 72 | 73 | // Header - default height 74 | .h-dh .site-header .nav1 .main-menu > li { 75 | padding: calc(#{structure.$size__spacing-unit} * 0.5) 0; 76 | } 77 | 78 | // Header - short height 79 | .h-sh { 80 | .site-header .nav1 .main-menu > li { 81 | padding: #{0.25 * structure.$size__spacing-unit} 0; 82 | 83 | > .sub-menu { 84 | padding-top: 20px; 85 | 86 | &::before { 87 | top: 12px; 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /newspack-theme/sass/navigation/_menu-secondary-navigation.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/structure"; 2 | 3 | .nav2 { 4 | ul, 5 | li { 6 | list-style: none; 7 | margin: 0; 8 | padding: 0; 9 | } 10 | 11 | a { 12 | color: inherit; 13 | padding: #{0.125 * structure.$size__spacing-unit} #{0.25 * structure.$size__spacing-unit}; 14 | } 15 | 16 | > ul > li > a:hover { 17 | opacity: 0.75; 18 | } 19 | } 20 | 21 | /* Desktop-specific styles */ 22 | .site-header { 23 | .nav2 { 24 | > ul, 25 | > ul > li { 26 | align-items: center; 27 | display: flex; 28 | flex-wrap: wrap; 29 | } 30 | 31 | li { 32 | margin-right: #{structure.$size__spacing-unit}; 33 | } 34 | 35 | > li:first-child a { 36 | padding-left: 0; 37 | } 38 | 39 | a { 40 | font-size: var(--newspack-theme-font-size-xs); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /newspack-theme/sass/navigation/_menu-social-navigation.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/transitions"; 2 | 3 | /* Social menu */ 4 | 5 | .social-navigation, 6 | .social-links-menu { 7 | align-items: center; 8 | display: flex; 9 | } 10 | 11 | .social-links-menu { 12 | margin: 0; 13 | padding: 0; 14 | 15 | li { 16 | list-style: none; 17 | 18 | &:nth-child(n + 2) { 19 | margin-left: 0.5em; 20 | } 21 | 22 | a { 23 | border-bottom: 1px solid transparent; 24 | display: block; 25 | color: inherit; 26 | margin-bottom: -1px; 27 | transition: opacity transitions.$link_transition ease-in-out; 28 | 29 | &:hover, 30 | &:active { 31 | opacity: 0.7; 32 | } 33 | 34 | &:focus { 35 | opacity: 1; 36 | border-bottom: 1px solid currentcolor; 37 | } 38 | 39 | svg { 40 | display: block; 41 | width: 24px; 42 | height: 24px; 43 | 44 | // Prevent icons from jumping in Safari using hardware acceleration. 45 | transform: translateZ(0); 46 | 47 | &#ui-icon-link { 48 | transform: rotate(-45deg); 49 | } 50 | } 51 | } 52 | } 53 | } 54 | 55 | .social-navigation .social-links-menu { 56 | flex-wrap: nowrap; 57 | overflow: visible; 58 | } 59 | 60 | .h-sh .top-header-contain .social-links-menu li a svg { 61 | height: 20px; 62 | width: 20px; 63 | } 64 | -------------------------------------------------------------------------------- /newspack-theme/sass/navigation/_menu-tertiary-navigation.scss: -------------------------------------------------------------------------------- 1 | @use "../mixins/utilities"; 2 | @use "../variables-site/structure"; 3 | 4 | /** === Tertiary menu === */ 5 | 6 | .nav3 { 7 | align-items: center; 8 | display: flex; 9 | list-style: none; 10 | padding: 0; 11 | 12 | ul, 13 | li { 14 | list-style: none; 15 | margin: 0; 16 | padding: 0; 17 | } 18 | 19 | a { 20 | color: inherit; 21 | display: inline-block; 22 | padding: #{0.25 * structure.$size__spacing-unit} 0; 23 | 24 | &:hover { 25 | opacity: 0.75; 26 | } 27 | } 28 | 29 | .menu-highlight a { 30 | border: 1px solid currentcolor; 31 | font-weight: bold; 32 | padding-left: #{structure.$size__spacing-unit * 0.5}; 33 | padding-right: #{structure.$size__spacing-unit * 0.5}; 34 | } 35 | } 36 | 37 | // Header - default background and default height 38 | body.h-db.h-dh .site-header { 39 | .nav3 { 40 | .menu-highlight a { 41 | background-color: var(--newspack-theme-color-primary); 42 | border: 0; 43 | color: var(--newspack-theme-color-against-primary); 44 | 45 | &:hover { 46 | background-color: var(--newspack-theme-color-text-main); 47 | color: var(--newspack-theme-color-bg-body); 48 | } 49 | } 50 | } 51 | } 52 | 53 | // Styles for when menu items appear in the site-header. 54 | .site-header .nav3 { 55 | @include utilities.media( tablet ) { 56 | text-align: right; 57 | } 58 | 59 | li { 60 | display: inline-block; 61 | font-size: var(--newspack-theme-font-size-xs); 62 | 63 | @include utilities.media( tablet ) { 64 | &:nth-child(n + 2) { 65 | margin: 0 0 0 #{structure.$size__spacing-unit * 0.75}; 66 | } 67 | } 68 | } 69 | 70 | a { 71 | margin: #{structure.$size__spacing-unit * 0.25} 0; 72 | } 73 | 74 | // Header Short Height 75 | .h-sh & { 76 | font-size: var(--newspack-theme-font-size-base); 77 | margin-left: structure.$size__spacing-unit; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /newspack-theme/sass/navigation/_navigation.scss: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------- 2 | ## Links 3 | -------------------------------------------------------------- */ 4 | @use "links"; 5 | 6 | /* -------------------------------------------------------------- 7 | ## Menus 8 | -------------------------------------------------------------- */ 9 | @use "menu-dropdown"; 10 | @use "menu-main-navigation"; 11 | @use "menu-secondary-navigation"; 12 | @use "menu-tertiary-navigation"; 13 | @use "menu-highlight-navigation"; 14 | @use "menu-social-navigation"; 15 | @use "menu-mobile-navigation"; 16 | 17 | /* -------------------------------------------------------------- 18 | ## Next / Previous 19 | -------------------------------------------------------------- */ 20 | @use "next-previous"; 21 | 22 | /* -------------------------------------------------------------- 23 | ## Infinite Scroll 24 | -------------------------------------------------------------- */ 25 | @use "infinite-scroll"; 26 | -------------------------------------------------------------------------------- /newspack-theme/sass/plugins/newspack-listings.scss: -------------------------------------------------------------------------------- 1 | // Listings 2 | .newspack-listings { 3 | &.hide-date.hide-author { 4 | .entry-subhead { 5 | padding: 0; 6 | } 7 | } 8 | } 9 | 10 | .wpnbha .featured-listing[class*="type-newspack_lst_"] .entry-title a, 11 | .wpnbpc .featured-listing[class*="type-newspack_lst_"] .entry-title a, 12 | .archive .featured-listing[class*="type-newspack_lst_"] .entry-title a, 13 | .search .featured-listing[class*="type-newspack_lst_"] .entry-title a, 14 | .blog .featured-listing[class*="type-newspack_lst_"] .entry-title a, 15 | .newspack-listings__curated-list .featured-listing .newspack-listings__listing-title { 16 | &::before { 17 | border: calc(0.25em + 1px) solid var(--newspack-theme-color-primary); // half the width 18 | border-top: 0; 19 | border-bottom-color: transparent; // the 'cut in' 20 | box-sizing: border-box; 21 | content: ""; 22 | display: inline-block; 23 | height: 0.8em; 24 | margin-right: 0.3em; 25 | position: relative; 26 | top: 0.05em; 27 | width: 0.5em; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /newspack-theme/sass/plugins/newspack-newsletters-editor.scss: -------------------------------------------------------------------------------- 1 | /* !Newspack Newsletters Block styles */ 2 | 3 | //! Image 4 | .wp-block-image { 5 | img { 6 | display: block; 7 | } 8 | 9 | figcaption { 10 | text-align: left; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /newspack-theme/sass/plugins/newspack-publisher-media-kit.scss: -------------------------------------------------------------------------------- 1 | .publisher-media-kit { 2 | &__wrapper { 3 | &.wp-block-group { 4 | > .wp-block-group__inner-container { 5 | > * { 6 | margin-bottom: var(--wp--preset--spacing--80); 7 | margin-top: var(--wp--preset--spacing--80); 8 | 9 | &:first-child { 10 | margin-top: 0; 11 | } 12 | 13 | &:last-child { 14 | margin-bottom: 0; 15 | 16 | .page-template-no-header-footer-php & { 17 | margin-bottom: var(--wp--preset--spacing--80); 18 | } 19 | } 20 | } 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /newspack-theme/sass/plugins/newspack-sponsors-editor.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/variables-site"; 2 | @use "../mixins/mixins-main"; 3 | @use "../variables-site/structure"; 4 | 5 | // Newspack Blocks 6 | .sponsor-label { 7 | .flag { 8 | background: var(--newspack-theme-color-highlight); 9 | color: var(--newspack-theme-color-text-main); 10 | line-height: 1; 11 | padding: 0.3em 0.5em; 12 | text-transform: uppercase; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /newspack-theme/sass/plugins/trust-indicators.scss: -------------------------------------------------------------------------------- 1 | @use "../variables-site/variables-site"; 2 | @use "../mixins/mixins-main"; 3 | @use "../mixins/utilities"; 4 | @use "../variables-site/structure"; 5 | 6 | .trust-label { 7 | display: block; 8 | font-size: 90%; 9 | 10 | @include utilities.media( mobile ) { 11 | display: inline; 12 | margin-left: structure.$size__spacing-unit; 13 | } 14 | svg { 15 | margin-right: #{0.1 * structure.$size__spacing-unit}; 16 | position: relative; 17 | top: 5px; 18 | } 19 | } 20 | 21 | .single .cat-links { 22 | vertical-align: middle; 23 | .type-of-work { 24 | color: var(--newspack-theme-color-text-main); 25 | margin-right: 0.5em; 26 | } 27 | } 28 | 29 | .author-expanded-social-link { 30 | display: flex; 31 | align-items: center; 32 | margin: 0 1rem 0.5rem 0; 33 | width: 100%; 34 | 35 | svg { 36 | margin-right: #{0.25 * structure.$size__spacing-unit}; 37 | } 38 | } 39 | 40 | /* Author archives */ 41 | .archive.author { 42 | // Hide default archive title & accent 43 | .page-subtitle, 44 | .page-title::before, 45 | // Hide default social links 46 | .author-meta { 47 | display: none; 48 | } 49 | 50 | .author-job-title { 51 | display: block; 52 | margin-top: #{0.25 * structure.$size__spacing-unit}; 53 | } 54 | 55 | .author-meta.trust-indicators { 56 | display: flex; 57 | flex-wrap: wrap; 58 | } 59 | 60 | .author-social-links { 61 | border-left: none; 62 | margin-left: 0; 63 | padding-left: 0; 64 | } 65 | 66 | /* Hide small Twitter icon, because a bigger one is present */ 67 | .author-social-links .twitter { 68 | display: none; 69 | } 70 | } 71 | 72 | .author-additional-infos { 73 | display: flex; 74 | flex-wrap: wrap; 75 | font-size: var(--newspack-theme-font-size-sm); 76 | } 77 | 78 | .author-additional-info { 79 | width: 100%; 80 | h4 { 81 | margin-bottom: 0; 82 | } 83 | p { 84 | margin-top: 0; 85 | } 86 | } 87 | 88 | .featured-image-behind, 89 | .featured-image-beside { 90 | .cat-links .type-of-work, 91 | .trust-label:hover { 92 | color: inherit; 93 | } 94 | 95 | svg.trust-label__icon path { 96 | fill: inherit; 97 | } 98 | } 99 | 100 | .featured-image-behind { 101 | .trust-label { 102 | color: #fff; 103 | } 104 | } 105 | 106 | .featured-image-beside { 107 | .trust-label { 108 | display: block; 109 | margin: #{0.25 * structure.$size__spacing-unit} 0 0; 110 | width: 100%; 111 | } 112 | } 113 | 114 | @include utilities.media( mobile ) { 115 | .author-additional-info { 116 | width: 50%; 117 | } 118 | .author-expanded-social-link { 119 | width: inherit; 120 | } 121 | .archive.author { 122 | .author-meta.trust-indicators { 123 | .author-social-links { 124 | margin: 0 0 0.33rem; 125 | } 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /newspack-theme/sass/plugins/yoast-breadcrumb.scss: -------------------------------------------------------------------------------- 1 | .site-breadcrumb { 2 | color: var(--newspack-theme-color-text-light); 3 | 4 | .wrapper { 5 | padding: 0.5em 0; 6 | 7 | > span { 8 | font-family: var(--newspack-theme-font-heading); 9 | font-size: var(--newspack-theme-font-size-xxs); 10 | line-height: var(--newspack-theme-font-line-height-heading); 11 | } 12 | } 13 | 14 | .breadcrumb_last { 15 | color: var(--newspack-theme-color-text-main); 16 | } 17 | 18 | // Hide on homepage and if the Featured Image is Behind or Beside 19 | .home &, 20 | .single-featured-image-behind &, 21 | .single-featured-image-beside & { 22 | display: none; 23 | } 24 | 25 | // Has Highlight Menu 26 | .has-highlight-menu & { 27 | padding-top: 0.25rem; 28 | 29 | .wrapper { 30 | border-top: 1px solid var(--newspack-theme-color-border); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /newspack-theme/sass/site/_site.scss: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------- 2 | ## Header 3 | -------------------------------------------------------------- */ 4 | @use "header/site-header"; 5 | 6 | /* -------------------------------------------------------------- 7 | ## Posts and pages 8 | -------------------------------------------------------------- */ 9 | @use "primary/posts-and-pages"; 10 | 11 | /* -------------------------------------------------------------- 12 | ## Comments 13 | -------------------------------------------------------------- */ 14 | @use "primary/comments"; 15 | 16 | /* -------------------------------------------------------------- 17 | ## Archives 18 | -------------------------------------------------------------- */ 19 | @use "primary/archives"; 20 | 21 | /* -------------------------------------------------------------- 22 | ## Footer 23 | -------------------------------------------------------------- */ 24 | @use "footer/site-footer"; 25 | -------------------------------------------------------------------------------- /newspack-theme/sass/style-base.scss: -------------------------------------------------------------------------------- 1 | /* Mixins */ 2 | @use "mixins/mixins-main"; 3 | 4 | /* Normalize */ 5 | 6 | @use "normalize"; 7 | 8 | /* Typography */ 9 | 10 | @use "typography/typography"; 11 | 12 | /* Elements */ 13 | 14 | @use "elements/elements"; 15 | 16 | /* Forms */ 17 | 18 | @use "forms/forms"; 19 | 20 | /* Navigation */ 21 | 22 | @use "navigation/navigation"; 23 | 24 | /* Accessibility */ 25 | 26 | @use "modules/accessibility"; 27 | 28 | /* Alignments */ 29 | 30 | @use "modules/alignments"; 31 | 32 | /* Clearings */ 33 | 34 | @use "modules/clearings"; 35 | 36 | /* Layout */ 37 | 38 | @use "layout/layout"; 39 | 40 | /* Content */ 41 | 42 | @use "site/site"; 43 | 44 | /* Widgets */ 45 | 46 | @use "site/secondary/widgets"; 47 | 48 | /* Blocks */ 49 | 50 | @use "blocks/blocks"; 51 | 52 | /* Media */ 53 | 54 | @use "media/media"; 55 | 56 | /* Newspack Ads support */ 57 | 58 | @use "plugins/newspack-ads"; 59 | 60 | /* Yoast Breadcrumb support */ 61 | 62 | @use "plugins/yoast-breadcrumb"; 63 | 64 | /* Newspack Listings support */ 65 | 66 | @use "plugins/newspack-listings"; 67 | 68 | /* Newspack Publisher Media Kit */ 69 | 70 | @use "plugins/newspack-publisher-media-kit"; 71 | -------------------------------------------------------------------------------- /newspack-theme/sass/style-editor-customizer.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | Newspack Theme Customizer Styles 3 | 4 | NOTE: This file is automatically populated with styles if the user selects a custom primary color in the customzier. 5 | */ 6 | -------------------------------------------------------------------------------- /newspack-theme/sass/style-editor.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | Newspack Theme Editor Styles 3 | */ 4 | 5 | /** === Includes === */ 6 | 7 | @use "variables-site/variables-site"; 8 | @use "style-editor-base"; 9 | @use "styles/style-default/style-default-editor"; 10 | -------------------------------------------------------------------------------- /newspack-theme/sass/style.scss: -------------------------------------------------------------------------------- 1 | @use "theme-description"; 2 | @use "variables-site/variables-site"; 3 | @use "variables-site/colors"; 4 | @use "variables-site/fonts"; 5 | @use "style-base"; 6 | @use "styles/style-default/style-default"; 7 | -------------------------------------------------------------------------------- /newspack-theme/sass/styles/style-default/style-default-editor.scss: -------------------------------------------------------------------------------- 1 | @use "../../variables-site/structure"; 2 | 3 | .accent-header, 4 | .article-section-title { 5 | border-bottom: 4px solid var(--newspack-theme-color-border); 6 | color: var(--newspack-theme-color-primary-against-white); 7 | font-size: var(--newspack-theme-font-size-sm); 8 | margin-top: 0; 9 | margin-bottom: #{structure.$size__spacing-unit * 0.75}; 10 | padding: 0 0 #{structure.$size__spacing-unit * 0.33}; 11 | } 12 | -------------------------------------------------------------------------------- /newspack-theme/sass/theme-description.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | Theme Name: Newspack 3 | Theme URI: https://github.com/Automattic/newspack-theme 4 | Author: Automattic 5 | Author URI: https://newspack.com 6 | Description: The official theme for Newspack, an all-in-one platform that simplifies publishing and drives audience and revenue right out of the box. 7 | Requires at least: 6.7 8 | Tested up to: 6.8 9 | Version: 2.9.1 10 | License: GNU General Public License v2 or later 11 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 12 | Text Domain: newspack 13 | Tags: Newspack 14 | 15 | This theme, like WordPress, is licensed under the GPL. 16 | Use it to make something cool, have fun, and share what you've learned with others. 17 | 18 | Newspack Theme is based on Underscores https://underscores.me/, (C) 2012-2018 Automattic, Inc. 19 | Underscores is distributed under the terms of the GNU GPL v2 or later. 20 | 21 | Normalizing styles have been helped along thanks to the fine work of 22 | Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/ 23 | */ 24 | 25 | /* -------------------------------------------------------------- 26 | >>> TABLE OF CONTENTS: 27 | ---------------------------------------------------------------- 28 | # Variables 29 | # Normalize 30 | # Typography 31 | ## Headings 32 | ## Copy 33 | # Elements 34 | ## Lists 35 | ## Tables 36 | # Forms 37 | ## Buttons 38 | ## Fields 39 | # Navigation 40 | ## Links 41 | ## Menus 42 | ## Next & Previous 43 | # Accessibility 44 | # Alignments 45 | # Clearings 46 | # Layout 47 | # Widgets 48 | # Content 49 | ## Archives 50 | ## Posts and pages 51 | ## Comments 52 | # Blocks 53 | ## Patterns 54 | # Media 55 | ## Captions 56 | ## Galleries 57 | -------------------------------------------------------------- */ 58 | -------------------------------------------------------------------------------- /newspack-theme/sass/typography/_copy.scss: -------------------------------------------------------------------------------- 1 | p { 2 | -webkit-font-smoothing: antialiased; 3 | -moz-osx-font-smoothing: grayscale; 4 | } 5 | 6 | dfn, 7 | cite, 8 | em, 9 | i { 10 | font-style: italic; 11 | } 12 | 13 | blockquote { 14 | cite { 15 | font-family: var(--newspack-theme-font-heading); 16 | font-size: var(--newspack-theme-font-size-xs); 17 | font-style: normal; 18 | } 19 | } 20 | 21 | pre { 22 | font-size: var(--newspack-theme-font-size-sm); 23 | font-family: var(--newspack-theme-font-pre); 24 | line-height: var(--newspack-theme-font-line-height-body); 25 | overflow: auto; 26 | } 27 | 28 | code, 29 | kbd, 30 | tt, 31 | var { 32 | font-size: var(--newspack-theme-font-size-sm); 33 | font-family: var(--newspack-theme-font-code); 34 | } 35 | 36 | abbr, 37 | acronym { 38 | border-bottom: 1px dotted #666; 39 | cursor: help; 40 | } 41 | 42 | mark, 43 | ins { 44 | background: #fff9c0; 45 | text-decoration: none; 46 | } 47 | 48 | big { 49 | font-size: 125%; 50 | } 51 | 52 | a { 53 | text-decoration: none; 54 | 55 | &:hover { 56 | text-decoration: none; 57 | } 58 | 59 | &:focus { 60 | text-decoration: underline; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /newspack-theme/sass/typography/_typography.scss: -------------------------------------------------------------------------------- 1 | @use "sass:meta"; 2 | @use "../mixins/mixins-main"; 3 | @use "../mixins/utilities"; 4 | 5 | html { 6 | font-size: var(--newspack-theme-font-size-base-sm); 7 | 8 | @include utilities.media( mobile ) { 9 | font-size: var(--newspack-theme-font-size-base); 10 | } 11 | } 12 | 13 | body { 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | color: var(--newspack-theme-color-text-main); 17 | font-family: var(--newspack-theme-font-body); 18 | font-weight: 400; 19 | font-size: 1em; 20 | line-height: var(--newspack-theme-font-line-height-body); 21 | margin: 0; 22 | text-rendering: optimizelegibility; 23 | } 24 | 25 | button, 26 | input, 27 | select, 28 | optgroup, 29 | textarea { 30 | color: var(--newspack-theme-color-text-main); 31 | font-family: var(--newspack-theme-font-body); 32 | font-weight: 400; 33 | line-height: var(--newspack-theme-font-line-height-body); 34 | text-rendering: optimizelegibility; 35 | } 36 | 37 | .use-body-font { 38 | font-family: var(--newspack-theme-font-body); 39 | } 40 | 41 | @include meta.load-css( "headings" ); 42 | 43 | @include meta.load-css( "copy" ); 44 | -------------------------------------------------------------------------------- /newspack-theme/sass/variables-site/_colors.scss: -------------------------------------------------------------------------------- 1 | // Custom Colors - defaults 2 | :root { 3 | --newspack-theme-color-primary: #003da5; // TODO: rename --newspack-primary-color, --newspack-listings--primary elsewhere 4 | --newspack-theme-color-primary-variation: #2055b0; 5 | --newspack-theme-color-secondary: #555; // TODO: replace --newspack-secondary-color elsewhere 6 | --newspack-theme-color-secondary-variation: #3e3e3e; 7 | --newspack-theme-color-highlight: #fed850; 8 | --newspack-theme-color-primary-darken-5: #00296e; // TODO: find a better approach than being this literal. 9 | --newspack-theme-color-primary-darken-10: #001f53; // TODO: find a better approach than being this literal. 10 | 11 | // Constast colors - text against white background, if light changes to grey: 12 | --newspack-theme-color-primary-against-white: var(--newspack-theme-color-primary); // primary color against white bg. 13 | --newspack-theme-color-secondary-against-white: var(--newspack-theme-color-secondary); // secondary color against white bg. 14 | 15 | // Contrast colors - text to use against primary or secondary (black or white) 16 | --newspack-theme-color-against-primary: #fff; // text color on top of primary color bg. 17 | --newspack-theme-color-against-secondary: #fff; // text color on top of primary color bg. 18 | 19 | // Backgrounds 20 | --newspack-theme-color-bg-body: #fff; 21 | --newspack-theme-color-bg-input: var(--newspack-theme-color-bg-body); 22 | --newspack-theme-color-bg-light: #f0f0f0; 23 | --newspack-theme-color-bg-button-hover: #111; 24 | --newspack-theme-color-bg-pre: #eee; 25 | --newspack-theme-color-bg-pre-lighten-5: #fbfbfb; // TODO: find a better approach than being this literal. 26 | --newspack-theme-color-bg-dark: #333; 27 | --newspack-theme-color-bg-dark-lighten-5: #404040; // TODO: find a better approach than being this literal. 28 | --newspack-theme-color-bg-dark-darken-5: #262626; // TODO: find a better approach than being this literal. 29 | 30 | // Text 31 | --newspack-theme-color-text-main: #111; 32 | --newspack-theme-color-text-light: #515151; 33 | --newspack-theme-color-text-hover: var(--newspack-theme-color-bg-dark-lighten-5); 34 | --newspack-theme-color-text-screen: #21759b; 35 | 36 | // Links 37 | --newspack-theme-color-link: var(--newspack-theme-color-secondary); 38 | --newspack-theme-color-link-hover: var(--newspack-theme-color-secondary-variation-against-white); 39 | 40 | // Borders 41 | --newspack-theme-color-border: #ccc; 42 | --newspack-theme-color-border-light: #e0e0e0; 43 | 44 | // Alert 45 | --newspack-theme-color-alert-yellow: #dba617; 46 | --newspack-theme-color-alert-red: #d63638; 47 | --newspack-theme-color-alert-green: #008a20; 48 | } 49 | -------------------------------------------------------------------------------- /newspack-theme/sass/variables-site/_fonts.scss: -------------------------------------------------------------------------------- 1 | // Font and typographic variables 2 | 3 | :root { 4 | --newspack-theme-font-body: georgia, garamond, "Times New Roman", serif; 5 | --newspack-theme-font-heading: 6 | -apple-system, 7 | blinkmacsystemfont, 8 | "Segoe UI", 9 | "Roboto", 10 | "Oxygen", 11 | "Ubuntu", 12 | "Cantarell", 13 | "Fira Sans", 14 | "Droid Sans", 15 | "Helvetica Neue", 16 | sans-serif; 17 | --newspack-theme-font-code: menlo, monaco, consolas, lucida console, monospace; 18 | --newspack-theme-font-pre: "Courier 10 Pitch", courier, monospace; 19 | --newspack-theme-font-size-base: 20px; 20 | --newspack-theme-font-size-base-sm: 18px; 21 | --newspack-theme-font-size-ratio: 1.125; 22 | --newspack-theme-font-size-xxs: calc(1em * 0.6); // 12px 23 | --newspack-theme-font-size-xs: calc(1em * 0.7); // 14px 24 | --newspack-theme-font-size-sm: calc(1em * 0.8); // 16px 25 | --newspack-theme-font-size-md: calc(1em * 1.2); // 24px 26 | --newspack-theme-font-size-lg: calc(1em * 1.4); // 28px 27 | --newspack-theme-font-size-xl: calc(1em * 1.8); // 36px 28 | --newspack-theme-font-size-xxl: calc(1em * 2.2); // 44px 29 | --newspack-theme-font-size-xxxl: calc(1em * 2.8); // 56px 30 | --newspack-theme-font-size-xxxxl: calc(1em * 3.2); // 64px 31 | --newspack-theme-font-size-xxxxxl: calc(1em * 4); // 80px 32 | --newspack-theme-font-line-height-body: 1.6; 33 | --newspack-theme-font-line-height-heading: 1.2; 34 | } 35 | -------------------------------------------------------------------------------- /newspack-theme/sass/variables-site/_newspack-ui.scss: -------------------------------------------------------------------------------- 1 | @use "../mixins/utilities"; 2 | 3 | html body { 4 | // Override the Newspack UI font sizes to be based off of the Newspack Theme's 18px font base: 5 | --newspack-ui-font-size-m: clamp(1rem, 0.04rem + 2.209vw, 1.611rem); // 18px - 20px 6 | --newspack-ui-font-size-l: clamp(1.111rem, 0.762rem + 0.803vw, 1.333rem); // 20px - 24px 7 | --newspack-ui-font-size-xl: clamp(1.222rem, 0.35rem + 2.008vw, 1.778rem); // 22px - 32px 8 | --newspack-ui-font-size-2xl: clamp(1.444rem, 0.049rem + 3.213vw, 2.333rem); // 26px - 42px 9 | --newspack-ui-font-size-3xl: clamp(1.556rem, -0.189rem + 4.016vw, 2.667rem); // 28px - 48px 10 | --newspack-ui-font-size-4xl: clamp(1.778rem, -1.014rem + 6.426vw, 3.556rem); // 32px - 64px 11 | --newspack-ui-font-size-5xl: clamp(1.889rem, -2.124rem + 9.237vw, 4.444rem); // 34px - 80px 12 | --newspack-ui-font-size-6xl: clamp(2rem, -3.234rem + 12.048vw, 5.333rem); // 36px - 96px 13 | 14 | @include utilities.media( mobile ) { 15 | // Override the Newspack UI font sizes to be based off of the Newspack Theme's 20px font base on desktop: 16 | --newspack-ui-font-size-m: clamp(0.9rem, 0.743rem + 0.402vw, 1rem); // 18px - 20px 17 | --newspack-ui-font-size-l: clamp(1rem, 0.686rem + 0.803vw, 1.2rem); // 20px - 24px 18 | --newspack-ui-font-size-xl: clamp(1.1rem, 0.315rem + 2.008vw, 1.6rem); // 22px - 32px 19 | --newspack-ui-font-size-2xl: clamp(1.3rem, 0.044rem + 3.213vw, 2.1rem); // 26px - 42px 20 | --newspack-ui-font-size-3xl: clamp(1.4rem, -0.17rem + 4.016vw, 2.4rem); // 28px - 48px 21 | --newspack-ui-font-size-4xl: clamp(1.6rem, -0.912rem + 6.426vw, 3.2rem); // 32px - 64px 22 | --newspack-ui-font-size-5xl: clamp(1.7rem, -1.912rem + 9.237vw, 4rem); // 34px - 80px 23 | --newspack-ui-font-size-6xl: clamp(1.8rem, -2.911rem + 12.048vw, 4.8rem); // 36px - 96px 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /newspack-theme/sass/variables-site/_structure.scss: -------------------------------------------------------------------------------- 1 | // Misc measurements. 2 | 3 | $size__spacing-unit: 1rem; 4 | $size__site-main: 1200px; 5 | $size__site-sidebar: 25%; 6 | $size__site-margins: calc(10% + 60px); 7 | $size__site-tablet-content: 65%; 8 | $size__site-desktop-content: 65%; 9 | $size__vertical-rhythm: 8px; 10 | 11 | // Responsive widths. 12 | 13 | $mobile_width: 600px; 14 | $tablet_width: 782px; 15 | $narrow_desktop_width: 960px; 16 | $desktop_width: 1168px; 17 | $wide_width: 1379px; 18 | 19 | // Gutenberg spacing variables. 20 | 21 | body { 22 | --wp--preset--spacing--50: clamp(1.25rem, 1rem + 0.8333vw, 1.5rem); 23 | --wp--preset--spacing--60: clamp(1.5rem, 0.75rem + 2.5vw, 2.25rem); 24 | --wp--preset--spacing--70: clamp(1.75rem, 0.12rem + 5.4333vw, 3.38rem); 25 | --wp--preset--spacing--80: clamp(2rem, -1.06rem + 10.2vw, 5.06rem); 26 | } 27 | 28 | -------------------------------------------------------------------------------- /newspack-theme/sass/variables-site/_transitions.scss: -------------------------------------------------------------------------------- 1 | // Transition timeouts. 2 | 3 | $link_transition: 110ms; 4 | $icon_transition: 120ms; 5 | $button_transition: 150ms; 6 | $background_transition: 200ms; 7 | -------------------------------------------------------------------------------- /newspack-theme/sass/variables-site/_variables-site.scss: -------------------------------------------------------------------------------- 1 | @use "newspack-ui"; 2 | @use "structure"; 3 | @use "transitions"; 4 | -------------------------------------------------------------------------------- /newspack-theme/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Automattic/newspack-theme/56563131fd256d3480467136de4334f782049ac0/newspack-theme/screenshot.png -------------------------------------------------------------------------------- /newspack-theme/search.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 | 15 | 21 | 22 |
23 | 24 | 25 | 26 | 50 |
51 | 52 |
53 | 54 | 10 | 11 | 23 | -------------------------------------------------------------------------------- /newspack-theme/sidebar.php: -------------------------------------------------------------------------------- 1 | 13 | 14 | 23 | -------------------------------------------------------------------------------- /newspack-theme/single-feature.php: -------------------------------------------------------------------------------- 1 | 15 | 16 |
17 |
18 | 19 | 30 |
31 | 32 |
33 | 34 | 35 |
36 | 37 | 60 |
61 | 62 | 63 | 64 |
65 |
66 | 67 | 15 | 16 |
17 |
18 | 19 | 30 |
31 | 32 |
33 | 34 | 35 |
36 | 37 | 60 |
61 | 62 | 63 | 64 |
65 |
66 | 67 | 12 | 13 |
14 |
15 | 16 | 26 |
27 | 28 |
29 | 30 | 31 | 32 |
33 | 34 | 54 |
55 | 56 | 60 | 61 |
62 |
63 | 64 | 19 | 20 |
> 21 | 22 | 23 |
24 | 37 |
38 | ', esc_url( get_permalink() ) ), '' ); ?> 39 |
40 | 41 | 42 | 43 | 56 | 57 | 64 | 65 | 66 |
67 |
68 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/content/content-corrections.php: -------------------------------------------------------------------------------- 1 | 23 | 24 |
> 25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 |
33 | 34 | 35 | 36 | 37 |
38 |
39 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/content/content-excerpt.php: -------------------------------------------------------------------------------- 1 | 19 | 20 |
> 21 | 22 | 23 |
24 | 37 |
38 | ', esc_url( get_permalink() ) ), '' ); ?> 39 |
40 | 41 | 42 | 43 | 56 | 57 | 64 | 65 | 66 | 67 |
68 | 69 |
70 |
71 |
72 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/content/content-none.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 | 16 | 17 |
18 | ' . wp_kses( 23 | /* translators: 1: link to WP admin new post page. */ 24 | __( 'Ready to publish your first post? Get started here.', 'newspack' ), 25 | array( 26 | 'a' => array( 27 | 'href' => array(), 28 | ), 29 | ) 30 | ) . '

', 31 | esc_url( admin_url( 'post-new.php' ) ) 32 | ); 33 | 34 | elseif ( is_search() ) : 35 | ?> 36 | 37 |

38 | 43 | 44 |

45 | 50 |
51 |
52 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/content/content-page.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
> 18 |
19 | '', 30 | ) 31 | ); 32 | ?> 33 |
34 | 35 | 36 |
37 | %s', 'newspack' ), 43 | array( 44 | 'span' => array( 45 | 'class' => array(), 46 | ), 47 | ) 48 | ), 49 | get_the_title() 50 | ), 51 | '', 52 | '' 53 | ); 54 | ?> 55 |
56 | 57 |
58 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/content/content-single.php: -------------------------------------------------------------------------------- 1 | 150, 18 | 'maxheight' => 100, 19 | ] 20 | ); 21 | $native_sponsors = newspack_get_native_sponsors( $all_sponsors ); 22 | $underwriter_sponsors = newspack_get_underwriter_sponsors( $all_sponsors ); 23 | } 24 | ?> 25 | 26 | 27 | 28 | 29 | 30 | 31 |
> 32 |
33 | 34 | 43 | 44 | "%s"', 'newspack' ), 50 | array( 51 | 'span' => array( 52 | 'class' => array(), 53 | ), 54 | ) 55 | ), 56 | get_the_title() 57 | ) 58 | ); 59 | 60 | wp_link_pages( 61 | array( 62 | 'before' => '', 64 | ) 65 | ); 66 | 67 | if ( is_active_sidebar( 'article-2' ) && is_single() ) { 68 | dynamic_sidebar( 'article-2' ); 69 | } 70 | ?> 71 |
72 | 73 |
74 | 75 |
76 | 77 | 83 | 84 |
85 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/content/content.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
> 13 |
14 | 15 |
16 | 17 | 18 | 19 |
20 | "%s"', 'newspack' ), 26 | array( 27 | 'span' => array( 28 | 'class' => array(), 29 | ), 30 | ) 31 | ), 32 | get_the_title() 33 | ) 34 | ); 35 | 36 | wp_link_pages( 37 | array( 38 | 'before' => '', 40 | ) 41 | ); 42 | ?> 43 |
44 | 45 |
46 | 47 |
48 |
49 | 50 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/footer/below-footer-widgets.php: -------------------------------------------------------------------------------- 1 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/footer/footer-branding.php: -------------------------------------------------------------------------------- 1 | 16 | 38 | 39 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/footer/footer-widgets.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/header/desktop-sidebar.php: -------------------------------------------------------------------------------- 1 | 11 | 12 | 16 | 17 | 32 | 33 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/header/header-search.php: -------------------------------------------------------------------------------- 1 | 8 | 9 |
10 | 17 | 20 |
21 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/header/mobile-sidebar.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 14 | 15 | 42 | 43 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/header/site-branding.php: -------------------------------------------------------------------------------- 1 | 8 |
9 | 10 | 11 | 12 |
13 | 19 |

20 | 21 |

22 | 23 |
24 | 25 |
26 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/header/subpage-sidebar.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 14 | 15 | 40 | 41 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/post/discussion-meta.php: -------------------------------------------------------------------------------- 1 | responses > 0; 11 | 12 | if ( $has_responses ) { 13 | /* translators: %1(X comments)$s */ 14 | $meta_label = apply_filters( 'newspack_number_comments', sprintf( _n( 15 | '%d Comment', 16 | '%d Comments', 17 | $discussion->responses, 'newspack' 18 | ), $discussion->responses ) ); 19 | 20 | } else { 21 | $meta_label = esc_html( apply_filters( 'newspack_no_comments', __( 'No comments', 'newspack' ) ) ); 22 | } 23 | ?> 24 | 25 |
26 |

27 | 28 | 29 |

30 |
31 | -------------------------------------------------------------------------------- /newspack-theme/template-parts/post/large-featured-image.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 21 | 22 | 23 | 24 | 25 | 26 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 |
51 | 52 |
53 | 54 | 20 |
21 | 22 | get_view_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 24 | 25 | if ( newspack_tec_show_sidebar() ) : 26 | get_sidebar(); 27 | endif; 28 | ?> 29 | 30 |
31 | 32 | 2 | 3 | Generally-applicable sniffs for WordPress plugins 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | . 23 | 24 | */dev-lib/* 25 | */node_modules/* 26 | */vendor/* 27 | */dist/* 28 | 29 | -------------------------------------------------------------------------------- /phpcs.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | A custom set of code standard rules to check for WordPress themes. 8 | 9 | 10 | /vendor/* 11 | /node_modules/* 12 | /tests/* 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 0 32 | 33 | 34 | -------------------------------------------------------------------------------- /phpstan.neon.dist: -------------------------------------------------------------------------------- 1 | #$ vendor/bin/phpstan analyse 2 | 3 | includes: 4 | - phar://phpstan.phar/conf/bleedingEdge.neon 5 | - vendor/szepeviktor/phpstan-wordpress/extension.neon 6 | parameters: 7 | # TODO level: max 8 | level: 4 9 | inferPrivatePropertyTypeFromConstructor: true 10 | paths: 11 | - %currentWorkingDirectory%/ 12 | excludes_analyse: 13 | - %currentWorkingDirectory%/woocommerce/checkout/ 14 | - %currentWorkingDirectory%/tests/ 15 | - %currentWorkingDirectory%/vendor/ 16 | autoload_files: 17 | # Stubs 18 | - %currentWorkingDirectory%/tests/bootstrap.php 19 | - %currentWorkingDirectory%/tests/functions-stubs.php 20 | # Files loaded from functions.php 21 | - %currentWorkingDirectory%/inc/back-compat.php 22 | - %currentWorkingDirectory%/inc/color-patterns.php 23 | - %currentWorkingDirectory%/inc/color-patterns.php 24 | - %currentWorkingDirectory%/classes/class-newspack-svg-icons.php 25 | - %currentWorkingDirectory%/classes/class-newspack-walker-comment.php 26 | - %currentWorkingDirectory%/inc/template-functions.php 27 | - %currentWorkingDirectory%/inc/color-filters.php 28 | - %currentWorkingDirectory%/inc/typography.php 29 | - %currentWorkingDirectory%/inc/icon-functions.php 30 | - %currentWorkingDirectory%/inc/template-tags.php 31 | - %currentWorkingDirectory%/inc/customizer.php 32 | - %currentWorkingDirectory%/inc/jetpack.php 33 | - %currentWorkingDirectory%/inc/woocommerce.php 34 | # Nothing to load 35 | ignoreErrors: 36 | # Uses func_get_args() 37 | - '#^Function apply_filters invoked with [34567] parameters, 2 required\.$#' 38 | - '#^Function add_theme_support invoked with [2345] parameters, 1 required\.$#' 39 | # WP nav menu 40 | - 41 | path: %currentWorkingDirectory%/inc/icon-functions.php 42 | message: '#^Cannot access property \$theme_location on array\.$#' 43 | - 44 | path: %currentWorkingDirectory%/inc/icon-functions.php 45 | message: '#^Access to an undefined property WP_Post::\$url\.$#' 46 | - 47 | path: %currentWorkingDirectory%/inc/icon-functions.php 48 | message: '#^Cannot access property \$link_after on array\.$#' 49 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Newspack Theme === 2 | Contributors: Automattic 3 | Tags: 4 | Requires at least: 6.7 5 | Tested up to: WordPress 6.8 6 | License: GPLv2 or later 7 | License URI: http://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | The theme for Newspack. https://newspack.com. 10 | 11 | == Resources == 12 | * Twenty Nineteen, © 2018-2019 WordPress, GNU GPL v2 or later 13 | * normalize.css, © 2012-2018 Nicolas Gallagher and Jonathan Neal, MIT 14 | * Underscores, © 2012-2018 Automattic, Inc., GNU GPL v2 or later -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | tag. 76 | */ 77 | function newspack_enqueue_editor_override_assets($classes) 78 | { 79 | } 80 | /** 81 | * Use front-page.php when Front page displays is set to a static page. 82 | * 83 | * @param string $template front-page.php. 84 | * 85 | * @return string The template to be used: blank if is_home() is true (defaults to index.php), else $template. 86 | */ 87 | function newspack_front_page_template($template) 88 | { 89 | } 90 | /** 91 | * Display custom color CSS in customizer and on frontend. 92 | */ 93 | function newspack_colors_css_wrap() 94 | { 95 | } 96 | /** 97 | * Display custom font CSS in customizer and on frontend. 98 | */ 99 | function newspack_typography_css_wrap() 100 | { 101 | } 102 | /** 103 | * Returns an array of 'acceptable' SVG tags to use with wp_kses(). 104 | */ 105 | function newspack_sanitize_svgs() 106 | { 107 | } 108 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | **** WARNING: No ES6 modules here. Not transpiled! **** 3 | */ 4 | /* eslint-disable import/no-nodejs-modules, @typescript-eslint/no-var-requires */ 5 | 6 | /** 7 | * External dependencies 8 | */ 9 | const fs = require( 'fs' ); 10 | const getBaseWebpackConfig = require( 'newspack-scripts/config/getWebpackConfig' ); 11 | const path = require( 'path' ); 12 | 13 | // Add all js/src/*.js scripts 14 | const entry = fs 15 | .readdirSync( path.join( __dirname, 'newspack-theme/js', 'src' ) ) 16 | .filter( script => 'js' === script.split( '.' ).pop() ) 17 | .reduce( ( obj, item ) => { 18 | const split = item.split( '.' ); 19 | split.pop(); 20 | return { 21 | ...obj, 22 | [ split.join( '.' ) ]: path.join( __dirname, 'newspack-theme/js', 'src', item ), 23 | }; 24 | }, {} ); 25 | 26 | // Add all js/src/*/index.js scripts 27 | fs.readdirSync( path.join( __dirname, 'newspack-theme/js', 'src' ) ) 28 | .filter( script => 29 | fs.existsSync( path.join( __dirname, 'newspack-theme/js', 'src', script, 'index.js' ) ) 30 | ) 31 | .forEach( function ( script ) { 32 | entry[ script ] = path.join( __dirname, 'newspack-theme/js', 'src', script, 'index.js' ); 33 | } ); 34 | 35 | const webpackConfig = getBaseWebpackConfig( { 36 | entry, 37 | } ); 38 | 39 | module.exports = webpackConfig; 40 | --------------------------------------------------------------------------------