-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44f3a1d
commit 615ef2a
Showing
11 changed files
with
941 additions
and
7 deletions.
There are no files selected for viewing
Submodule ucdlib-theme-wp
updated
3 files
+48 −31 | src/editor/lib/block-components/contact-list/contact-list-edit.js | |
+6 −1 | src/public/scss/style.scss | |
+2 −2 | views/blocks/heading-with-icon.twig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Command, Option } from 'commander'; | ||
import {JSDOM} from "jsdom"; | ||
|
||
import Config from "../lib/config.js"; | ||
import WpApi from "../lib/wp-api.js"; | ||
|
||
const program = new Command(); | ||
|
||
program | ||
.command('post-by-element') | ||
.description('Find posts that contain a specified DOM element') | ||
.argument('<query>', 'Args to pass to QuerySelector') | ||
.option('-t, --type <type...>', 'Post type to search', ['page']) | ||
.action(async (query, options) => { | ||
const foundPosts = []; | ||
const config = new Config(); | ||
const api = new WpApi(config); | ||
|
||
for (const postType of options.type) { | ||
const posts = await api.getPostsByTypeAll(postType); | ||
for (const post of posts) { | ||
const dom = new JSDOM(post.content.rendered); | ||
const elements = dom.window.document.querySelectorAll(query); | ||
if (elements.length > 0) { | ||
foundPosts.push(post); | ||
} | ||
} | ||
} | ||
|
||
console.log(`Found ${foundPosts.length} posts.`); | ||
for (const post of foundPosts) { | ||
console.log(post.link); | ||
} | ||
|
||
} | ||
); | ||
|
||
program.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! /usr/bin/env node | ||
import { Command } from 'commander'; | ||
|
||
const program = new Command(); | ||
program | ||
.name('ucdlib-wp-main') | ||
.version('0.0.1') | ||
.command('find', 'Query for posts') | ||
|
||
program.parse(process.argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Image Correction for Lightbox Plugin. | ||
|
||
The WP Gallery block has functionality that allows a user to bulk set the "link to" property on all image blocks. However, in some cases, [this does not work on our site](https://github.com/UCDavisLibrary/main-wp-website/issues/85#issuecomment-1535287882). The issue seems to be that when the gallery was originally imported, the images were uploaded, but the `data-id` attribute was not set. | ||
|
||
Luckily, it only affects 5 exhibits, which will just be manually fixed. |
Oops, something went wrong.